How can I change a joint's reference coordinate system through scripting?
Pernelle Marone-Hitz
Member, Moderator, Employee Posts: 871
✭✭✭✭
How can I modify the orientation of a joint's coordinate system through Mechanical scripting?
Tagged:
0
Answers
-
Here is an example of code to change the primary axis and its geometric selection:
# reference connections connections = ExtAPI.DataModel.Project.Model.Connections # get first joint inside connections my_joint=connections.GetChildren(DataModelObjectCategory.Joint,True)[0] # access the joint's reference coordinate system jointCS = my_joint.ReferenceCoordinateSystem # set joint's principal axis to global X axis jointCS.PrimaryAxis=CoordinateSystemAxisType.PositiveXAxis # obtain id of a face selected in Mechanical: currentSel=ExtAPI.SelectionManager.CurrentSelection # create a temporary selection tempSel=ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities) tempSel.Ids=currentSel.Ids # change joint's primary axis geometric selection to the selected face in Mechanical : jointCS.PrimaryAxisLocation=tempSel
0