Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Accesing an existing feature (body)

Message 1 of 2
84 Views, 1 Reply

Accesing an existing feature (body)



I would like to work with an existing extruded body. My goal is to be able to take an existing body, the same way I can take an existing sketch and manipulate it.


My end-goal is to:

  • manually create a sketch (airfoil shape)
  • access it and extrude it
  • export .step file 
  • let external software evaluate it and give me new information for the sketch
  • delete existing extruded body
  • edit existing sketch with new information
  • extrude it again and so on (Iteration)

The way I am now taking the existing sketch (This works)

# Take existing sketch
aerofoil = root.sketches.item(0)
# Take profile
prof = aerofoil.profiles.item(0)
Here I am taking similar aproach to existing extruded body (Doesn't work)
body = root.features.item(0)
removeFeat = removeFeatures.add(body)
The reason I am trying to delete the existing body, is to not have overlapping bodies when new extrusion is done on the edited sketch. 
Message 2 of 2
in reply to: pezlar.vojtech

If you want to delete the model and re-create it, it will be better to delete the extrude feature that created the body.


The other simpler option is to not delete anything but rely on the parametric nature of Fusion. Modify the sketch and then let everything else recompute. Of course, this assumes your design is set to be parametric. You can control this using the Options command that is available by clicking the gear on the right-hand side of the timeline, as shown below. The text shown is the setting you will be changing to. In this case, it is capturing design history, and running the command will be changing the design to NOT capture design history.




It will be good for you to forget about the API for a bit and experiment interactively with Fusion first to get a better idea of how it works. Once you've found what seems to be a good solution, then work on automating that.

Brian Ekins
Inventor and Fusion 360 API Expert

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th

Autodesk Design & Make Report