Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding

Accesing an existing feature (body)

pezlar.vojtech
Explorer Explorer
261 Views
1 Reply
Message 1 of 2

Accesing an existing feature (body)

pezlar.vojtech
Explorer
Explorer

Hello, 

 

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. 
0 Likes
262 Views
1 Reply
Reply (1)
Message 2 of 2

BrianEkins
Mentor
Mentor

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.

 

DesignHistory2.png

 

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
Website/Blog: https://EkinsSolutions.com
1 Like