Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I try to import component to existing geometry and then position it by creating joint. Here is the code:
newOccurence = rootComp.occurrences.addByInsert(myComponent, adsk.core.Matrix3D.create(), True)
# if "isReferencedComponent=False" then joint-problem resolved!
# geometry that is already existing = existingCircle
# geometry for imported component
helpSketch = newOccurence.component.sketches.itemByName("JointPositioning")
curve = helpSketch.sketchCurves.item(0)
# Create the first joint geometry - taken sketch in referenced component
geometryOrOriginOne = adsk.fusion.JointGeometry.createByCurve(curve, adsk.fusion.JointKeyPointTypes.CenterKeyPoint)
# Create the second joint geometry with the existingCircle
geometryOrOriginTwo = adsk.fusion.JointGeometry.createByCurve(existingCircle, adsk.fusion.JointKeyPointTypes.CenterKeyPoint)
joints = rootComp.joints
jointInput = joints.createInput(geometryOrOriginOne , ggeometryOrOriginTwoeo2)
jointInput.setAsRigidJointMotion()
joint = joints.add(jointInput) # Create the joint
I have to use "isReferencedComponent=True" option but then it gives me the error (above).
If I use "isReferencedComponent=False" the problem is gone. I guess the problem comes from "geometryOrOriginOne" being a sketch in referenced component, but how to overcome that? Please give me a hint.
Solved! Go to Solution.