Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro to delete all but active configuration

Status
Not open for further replies.

Beggar

Mechanical
Mar 24, 2004
715
I'm looking for a macro that will delete from a part file all but the active configuration.

Does anybody have one that they can share with me?

--------------------
Bring back the HP-15
--------------------
 
Replies continue below

Recommended for you

We use a small program called Departer. I think we got it from the web. I did a Google search and didn't come up with anything. I got scolded yesterday for giving out my email address but let me know of a way to contact you and I'll send you what we have. I do not know if its ok (for this forum) if I put in a "remove" in the email address
 
Just write a program that deletes all of the configs. SW will not allow the active config to be deleted.

Also, if a config is in use by another open file (i.e. assembly component or drawing) then that config will not delete.

Use the following calls to get you on your way:

retval = ModelDoc2.GetConfigurationNames( )

retval = ModelDoc2.DeleteConfiguration2 ( configurationName)


Use ModelDoc2.GetConfigurationNames to get the list of configurations, then use ModelDoc2.DeleteConfiguration2 to delete them.

[bat]Due to illness, the part of The Tick will be played by... The Tick.[bat]
 
Tick is right on, even if you selected all configs manually and then hit delete Solidworks will bark about the active config not being able to be deleted.


Side Note: if you use Design Tables with "allow model edits to update the table" turned off you will need to delete the configs in the design table, otherwise they will come back each time you open the table.

If the design table drives the model then the easiest thing to do is delete them in the table.
 
If anybody has a macro that deletes unused configurations in part files I would greatly appreciate it. I would pay for it if it works as we would like it to. I would like to open up an assembly that has all my part files open and run it from there. We have a lot of parts such as shoulder screws, cylinders, clamps, etc... that have multiple configs. Before shipping the final design we want to get rid of those configs without opening every part and doing it seperately. Does something like this exist?

 
Check out the DeteConfigurations macro at
I don't know if it will do exactly what you want, but it should give you a starting point anyway.

[cheers]
Making the best use of this Forum. faq559-716
How to get answers to your SW questions. faq559-1091
Helpful SW websites every user should be aware of. faq559-520
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor