# Some (hopefully) useful macros

**URL:** <https://forum.cadmunity.com/t/some-hopefully-useful-macros/3001>\
**Category:** Macro Library\
**Created:** [April 14, 2024, 12:35pm UTC](https://forum.cadmunity.com/t/some-hopefully-useful-macros/3001 "2024-04-14T12:35:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![laukejas](https://forum.cadmunity.com/user_avatar/forum.cadmunity.com/laukejas/32/6938_2.png) [@laukejas](https://forum.cadmunity.com/u/laukejas)\
**Post date:** [April 14, 2024, 12:35pm UTC](https://forum.cadmunity.com/t/some-hopefully-useful-macros/3001/1 "2024-04-14T12:35:50Z")

</div>

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 ([https://forum.cadmunity.com/t/revision-control-app-macro-release/1557/1](https://forum.cadmunity.com/t/revision-control-app-macro-release/1557/1)), 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.  
[Rebuild assembly parts.swp](https://forum.cadmunity.com/uploads/short-url/4ShCRWNBxNESN9kDA1VSgth6itP.swp) (44 KB)

---

<div class="post-metadata">

**Author:** ![gupta9665](https://forum.cadmunity.com/user_avatar/forum.cadmunity.com/gupta9665/32/6304_2.png) [@gupta9665](https://forum.cadmunity.com/u/gupta9665)\
**Post date:** [April 14, 2024, 1:17pm UTC](https://forum.cadmunity.com/t/some-hopefully-useful-macros/3001/2 "2024-04-14T13:17:29Z")

</div>

Thank you for sharing!!

---

<div class="post-metadata">

**Author:** ![AlexLachance](https://forum.cadmunity.com/user_avatar/forum.cadmunity.com/alexlachance/32/25_2.png) [@AlexLachance](https://forum.cadmunity.com/u/AlexLachance)\
**Post date:** [April 15, 2024, 11:51am UTC](https://forum.cadmunity.com/t/some-hopefully-useful-macros/3001/3 "2024-04-15T11:51:17Z")

</div>

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

[https://forum.cadmunity.com/t/my-macros/137/1](https://forum.cadmunity.com/t/my-macros/137/1)
