Script to erase components

Script to erase components

ManuMaker_MMK
Observer Observer
473 Views
2 Replies
Message 1 of 3

Script to erase components

ManuMaker_MMK
Observer
Observer

Hello community,
I am looking to create a script to remove several components from a STEP file.
My entry point is:
- A STEP file which includes about 2500 components
- A CSV or XML file that includes the list of components that I must keep
The script I want to create will allow me to open my original STEP file, select the components I want to keep, invert the selection and remove the components.

Do you think this type of script is possible with Fusion 360?

Thank you in advance for your answers.

0 Likes
474 Views
2 Replies
Replies (2)
Message 2 of 3

BrianEkins
Mentor
Mentor

This should be possible. What you'll be deleting are "occurrence" objects. Here's a topic from the help that describes the difference between a component and an occurrence. The other thing you'll need to handle is multiple instances of the same part and multiple levels. For example, you might have a part called "Bolt1" and have 4 instances of that in the top-level of the assembly. This results in the occurrences "Bolt1:1", "Bolt1:2", "Bolt1:3", and "Bolt1:4". If you only want to delete 2 of those 4, how do you identify the specific bolts? I don't know if the naming in the STEP is consistent with the naming once it is translated into Fusion.

 

 

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 3 of 3

ManuMaker_MMK
Observer
Observer

Hello Brian,

Thanks for your response.

Your idea is correct about object occurrences. My wish is to use this macro in a semi automatic mode. For all the occurrences that I will have to keep partially, I will not delete them with the script. In a second step, I will manually delete these occurrences.
The script will help me achieve 80% of the task automatically, which will make me progress quickly.

 

Regards,

Emmanuel

0 Likes