Some (hopefully) useful macros

Library for macros
laukejas
Posts: 129
Joined: Sun Sep 05, 2021 8:27 am
Answers: 0
x 33
x 84

Some (hopefully) useful macros

Unread post by laukejas »

Hi,

Just wanted to share several macros I use in my day-to-day, most of them written myself.

Modify External References - small dialog to Lock / Unlock / Break all references for all components in the assembly. Useful with Master models.

Rebuild Assembly Parts - for when Force Rebuild doesn't cut it. This macro opens each part individually, shakes it down, saves and closes it. Should get these stuck references to update.

Set Image Quality For All Parts - quickly change imaqe quality for all components in an assembly. Useful when you have tons of components that have high quality setting inherited from template or something.

Toggle Tangent Edge Display - quickly toggle tangent edge view without having to go into Options.

Edit Component - we all know how annoying it is that you can't assign Edit Component / Part command to a keyboard shortcut or mouse gesture. But you can with this macro. Select face / feature of any component in the assembly, and it will enter Edit Component mode. Run it again without anything selected, and it will exit Edit Component mode.

Draw CoV - creates a sketch with a point that marks the center of volume (not mass) of the assembly components. Useful when parts have different materials and densities and CoM doesn't match CoV.

Each body to STL - exports each body from a multibody part to an STL. There are some naming rules in there (I use this in conjunction with my Revision Control App (viewtopic.php?t=1823), so there are rules to add revision name to the file. You might want to adjust naming for your use case.


Been a while since I used some of them, so if something doesn't work, let me know.
Attachments
Toggle tangent edge display.swp
(36.5 KiB) Downloaded 14 times
Set image quality for all parts.swp
(41 KiB) Downloaded 16 times
Modify external references.swp
(85 KiB) Downloaded 18 times
Rebuild assembly parts.swp
(44 KiB) Downloaded 16 times
Edit Component.swp
(38 KiB) Downloaded 15 times
Draw CoV.swp
(85.5 KiB) Downloaded 14 times
Each body to STL.swp
(53 KiB) Downloaded 14 times
User avatar
gupta9665
Posts: 359
Joined: Thu Mar 11, 2021 10:20 am
Answers: 20
Location: India
x 383
x 414

Re: Some (hopefully) useful macros

Unread post by gupta9665 »

Thank you for sharing!!
Deepak Gupta
SOLIDWORKS Consultant/Blogger
User avatar
AlexLachance
Posts: 1991
Joined: Thu Mar 11, 2021 8:14 am
Answers: 17
Location: Quebec
x 2155
x 1847

Re: Some (hopefully) useful macros

Unread post by AlexLachance »

If you'd like to add them there or perhaps use some there too, this thread has a collection of a bunch of macros:

viewtopic.php?t=74
Post Reply