Page 1 of 1

New or exsisting macro

Posted: Fri Sep 20, 2024 1:33 pm
by Bryan O
There are a lot of pet peeves that my coworkers do that annoy me.
Here is a short list LOL!:
• Saving a model zoomed in so when you open it, you’re looking at the side of a surface.
• Leaving unused features in part trees.
• Display states. We don’t use them but many leave display states linked to configurations and inadvertently make many copies of unused states.

I would like a macro that saves out a “clean” part/assembly.
I would like this macro to:
• Unlink display states
• Set the display state to <default>_Display State 1
• Delete all but <default>_Display State 1
• Delete all unused features/parts( and their children)
• Hide all sketches
• Return the display area to a default ISO view (full screen)
• Save the file (with option to close)

anyone have something or would be willing to write one?
I tried to record a macro to do this, but it stalls at the close. I looked at it and it looked like it was trying to rename the part to whatever the part I was recording that I used while I was recording it.

Re: New or exsisting macro

Posted: Sun Sep 22, 2024 4:04 am
by gupta9665
Try the attached macro, does not delete unused features/parts but covers rest others.

Re: New or exsisting macro

Posted: Mon Sep 23, 2024 9:23 am
by Bryan O
Thanks for the help Deepak.
I downloaded it and ran it but it did nothing.
Is there any restriction on where the file needs to be or anything else that stop it from running?

Re: New or exsisting macro

Posted: Mon Sep 23, 2024 2:18 pm
by gupta9665
Bryan O wrote: Mon Sep 23, 2024 9:23 am Thanks for the help Deepak.
I downloaded it and ran it but it did nothing.
Is there any restriction on where the file needs to be or anything else that stop it from running?
It should work on active file. Make sure you have set the references correctly to your installed version. Refer this video

If above does not fix the issue, then kindly share some sample files to check.

Re: New or exsisting macro

Posted: Mon Sep 23, 2024 3:45 pm
by Bryan O
Again, Thanks for the help Deepak.