Permanently delete or insert a part into an assembly with excel

Hi all

I have an assembly that I manage very well with an excel sheet thanks to the families of parts.
I start from an initial assembly with all my basic parts and my final assembly is drawn according to the parameters I enter. I can always delete parts I don't need with the command $ETAT@Piec<occurence> but I'd like to take it a step further by permanently deleting them from the FeatureManager. I would like to do this because I have 17 "specific" parts in addition to all my other components and there can only be one per assembly so I still end up with 16 parts in deleted state when I would no longer need them.

Another possibility is to remove all of them from the initial assembly and find a command that inserts a new component into my assembly but in this case you would also have to generate constraints (there are no worries to calculate the coordinates of the part)

Is there a possibility? Even outside the part family?

Thank you for your answers

Baptist

If I understand correctly, it goes beyond the part family and you have to go through a VBA macro.

As @PL says, you'll probably need a maccro. I'm not an expert in maccro language at all, but if you save each part in your part family separately and you use the command "Replace component with..." ", it should keep you the constraints you need.

All that remains is to write the specific maccro, and there I have no ability to help you :-(

1 Like

Thank you for your answers.

I suspected that I had to go through a maccro but I don't know anything about it!

I'm going to search, but by chance someone knows a support to help me?

A good start for macros can be to watch the tutorials I published on Lynkoa, especially save as that I commented on every line for beginners:

http://www.lynkoa.com/tutos/3d/macro-enregistrer-sous-avec-solidworks

See also:

http://www.lynkoa.com/tutos/3d/macro-solidworks-retirer-lecture-seule-pour-fichiers-de-bibliotheque

You can also make macros by learning (do the actions with the mouse and keyboard to see the code):

http://help.solidworks.com/2013/french/SolidWorks/sldworks/c_recording_playing_macros.htm

Don't hesitate to ask a new question if a particular problem is blocking!