Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi once again,
I'm trying to mimic the joint creation that works in the UI: define a rotaty joint by selecting one circle in each component:
# find 2 part that go together and joint them wiht the circle in sketch 'Skizze7'
for i in range(0,parts.count): print('current part: ' +parts.item(i).name) if(parts.item(i).name.startswith('pt1')): prox = parts.item(i); print(' found part: ' + str(prox.name)) comp = prox.component sketches0 = comp.sketches joint0 = sketches0.itemByName('Skizze7') circle0 = joint0.sketchCurves.sketchCircles.item(0) print(' circle: ' + str(circle0)) geo0 = adsk.fusion.JointGeometry.createByCurve(circle0, adsk.fusion.JointKeyPointTypes.CenterKeyPoint) elif(parts.item(i).name.startswith('pt2')): dist = parts.item(i); print('found part: ' + str(dist.name)) comp = dist.component sketches1 = comp.sketches joint1 = sketches1.itemByName('Skizze7') circle1 = joint1.sketchCurves.sketchCircles.item(0) print(' circle: ' + str(circle1)) geo1 = adsk.fusion.JointGeometry.createByCurve(circle1, adsk.fusion.JointKeyPointTypes.CenterKeyPoint) joints = root.joints jointInput = joints.createInput(geo0, geo1) jointInput.setAsRevoluteJointMotion(adsk.fusion.JointDirections.ZAxisJointDirection) # # # Create the joint joint = joints.add(jointInput)
I receive the following error:
Traceback (most recent call last): File "C:/sample.py", line 378, in run joint = joints.add(jointInput) File "C:/Users/knorr_s1/AppData/Local/Autodesk/webdeploy/production/2937474db5cdf8bca194aa6f1765e510127e0d47/Api/Python/packages\adsk\fusion.py", line 15181, in add return _fusion.Joints_add(self, *args) RuntimeError: 2 : InternalValidationError : request->setJointOrigins(jo1Def0, jo1Def1)
inspecting both JointGeometry objects I find nothing suspicious ( geometrytype: 4 , keyPointType: 3 like in the manually joined assembly).
What do I miss here?
Thanks for any suggestions!
Stefan
Solved! Go to Solution.