Message 1 of 2
SetAsCylindricalJointMotion: RuntiError 3: Cannot be editied before rolling back

Not applicable
04-26-2016
07:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm using the following code to define a cylindrical motion between a bolt and a screw driver model which are aligned on the Y Axis, I get the error:
Runtime Error 3: Cannot be Edited before Rolling Back
This happens when the line : "toolPath.setAsCylindricalJointMotion(direction)" is called.
what is causing this error and how can I make the code work?
def makeToolPath(self,jointGeometry, motionType, direction=None, rotationAxis =None, yaw=None,customDirection=None, customRotation=None, customYaw=None, object1=None, object2=None ): if object1 is None: object1=self.toolComponent if object2 is None: object2=self.objectComponent joints =self.objectInstance.asBuiltJoints occ1 = self.objectInstance.allOccurrencesByComponent(object1)[0] occ2 = self.objectInstance.allOccurrencesByComponent(object2)[0] toolPathInput = joints.createInput(occ1, occ2, jointGeometry) toolPath = joints.add(toolPathInput) if motionType == adsk.fusion.JointTypes.RigidJointType: toolPath.setAsRigidJointMotion() elif motionType==adsk.fusion.JointTypes.SliderJointType: toolPath.setAsSliderJointMotion(direction,customDirection) elif motionType==adsk.fusion.JointTypes.RevoluteJointType: toolPath.setAsRevoluteJointMotion(rotationAxis,customRotation) elif motionType==adsk.fusion.JointTypes.PlanarJointType: toolPath.setAsPlanarJointMotion(direction,customDirection) elif motionType==adsk.fusion.JointTypes.CylindricalJointType: toolPath.setAsCylindricalJointMotion(direction) elif motionType==adsk.fusion.JointTypes.PlanarJointType: toolPath.setAsPinSlotJointMotion(rotationAxis, direction, customRotation, customDirection) elif motionType==adsk.fusion.JointTypes.BallJointType: toolPath.setAsBallJointMotion(direction, yaw,customDirection, customYaw) else: raise TypeError("There is no motion type of "+motionType) return toolPath jointGeometry = adsk.fusion.JointGeometry.createByPoint(self.toolComponent.originConstructionPoint) direction = adsk.fusion.JointDirections.YAxisJointDirection motionType = adsk.fusion.JointTypes.CylindricalJointType self.setToolPath(jointGeometry, motionType, direction)