Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to write some Python code to create a rotate move feature on a body.
center_axis = comp.constructionAxes[0]
mci = adsk.core.ObjectCollection.create()
mci.add(my_feature.bodies[0])
mi = comp.features.moveFeatures.createInput2(mci)
mi.defineAsRotate(center_axis, adsk.core.ValueInput.createByString("10 deg"))
When "defineAsRotate" is called I get "Runtime Error: 3 : Invalid entity"
If I instead call "defineAsTranslateXYZ" it does indeed translate the body. I have also manually rotated the feature using the UI selecting my body and construction axis and it works correctly.
I must be missing something on how I'm supposed to call "defineAsRotate"
Full code here: https://github.com/joeferner/YAGA/blob/master/commands/spur_gear/spur_gear.py#L566-L569 and yes I know about the built in spur gear add-in and various other add-ins, I'm trying to make my spur gear add-in completely parametric with some extra features.
Solved! Go to Solution.