Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to insert an external component and rigid join it to sketch point, but i'm getting this error
return _fusion.Joints_add(self, input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: 3 : Provided input paths for joint are not valid.
this is my code.
app = adsk.core.Application.get()
ui = app.userInterface
des = adsk.fusion.Design.cast(app.activeProduct)
root = adsk.fusion.Component.cast(des.rootComponent)
#Select a face to make sketch on
face = ui.selectEntity("Select a Planar Face", "PlanarFaces").entity
#Make sketch on selected face
sketch = root.sketches.add(face)
#Add a sketch point
points = sketch.sketchPoints
sketchPoint = points.add(adsk.core.Point3D.create(0, 10, 0))
#Find component
exampleComponent = app.data.activeHub.dataProjects.item(0).rootFolder.dataFolders.itemByName("Autodesk Example").dataFiles.item(0)
#Insert Component
instantiate = root.occurrences
instantiateComponent = instantiate.addByInsert(exampleComponent, adsk.core.Matrix3D.create(), True)
#Get origin point
originComponent = instantiateComponent.component.originConstructionPoint
#Create joint geometry
jointPointComponent = adsk.fusion.JointGeometry.createByPoint(originComponent)
jointPointSketch = adsk.fusion.JointGeometry.createByPoint(sketchPoint)
#Joint settings
joints = root.joints
joint = joints.createInput(jointPointComponent, jointPointSketch)
#joint.angle = adsk.core.ValueInput.createByString('0 deg')
#joint.offset = adsk.core.ValueInput.createByString('0 mm')
joint.isFlipped = False
joint.setAsRigidJointMotion()
#Create joint
joints.add(joint)
when i do the same manually it's no problem.
hope someone can help me
Solved! Go to Solution.