- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to revolve the rectangle in the "SlotProfile" sketch to create a cylinder. That works in the user interface. I'm able to select one of the two halves, use the vertical axis of the sketch, and revolve 360 degrees to get a cylinder. (edit - looking back I actually selected the model's z axis. I'll look into that further) But the following extracted code gets an error on the last line: "RuntimeError: 3 : fail to get the ObjectPath of the axis". I tried the vDirection and normal of the referencePlane (not expecting them to work), and got the same error. I'm not really sure what the error is saying.
selectedSketchEntity = sketchSelectionInput.selection(0).entity selectedSketch = adsk.fusion.Sketch.cast(selectedSketchEntity)
revolveFeats = feats.revolveFeatures revolveInput = revolveFeats.createInput(refProfiles[0], selectedSketch.referencePlane.geometry.vDirection , adsk.fusion.FeatureOperations.JoinFeatureOperation) revFeat = revolveFeats.add(revolveInput)
The documentation for createInput says the axis parameter is of type Base, so maybe there are multiple types supported. The description says: "The axis can be a sketch line, construction axis, or linear edge".Since createInput accepted the axis parameter, so the type may be correct.
I want to revolve around the vertical axis of the sketch. I thought the sketch's "uDirection" would do that for me. (edit - the sketch's referencePlane is a ConstructionPlane object, I assumed the uDirection of the plane would qualify as a "construction axis")
Solved! Go to Solution.