Logo ZADAX.NET
Store Library Hive Blog Contact
SOLIDWORKS Multi\u002DBody Color Assignment Macro Showcase
Macro

SOLIDWORKS Multi-Body Color Assignment Macro

Version 1.0.0

Platform Solidworks

Multi-Body Color Assignment Macro is a C# macro for SOLIDWORKS that automatically assigns different colors to each solid body in a multi-body part. It includes preview mode, preserving existing colors, color reset, undo support, and an English summary report after execution.


Multi-Body Color Assignment Macro is a C# macro developed for SOLIDWORKS to make multi-body part models easier to inspect, identify, and visually organize.

The macro scans all solid bodies in the active SOLIDWORKS part document and assigns a different color to each body. The appearance is applied to the faces of each body, making each solid body visually distinguishable in complex multi-body models.

This macro is especially useful for:

  • Quickly distinguishing bodies in multi-body parts
  • Improving visual clarity during design review
  • Separating bodies visually in weldment, sheet metal, or combined modeling workflows
  • Reporting the number of bodies and colored faces
  • Preserving existing appearances while coloring only uncolored faces
  • Resetting previously assigned face colors

This version reduces repeated colors. Instead of relying only on a small fixed color palette, it generates more distinct colors using an HSV-based distribution. This helps reduce repeated or visually similar colors when the part contains many solid bodies.

The macro also includes a Preview Only mode. When this mode is enabled, no changes are applied to the model. Instead, the macro generates an English report showing which body would receive which color. This allows the user to review the planned operation before applying any appearance changes.

Another important option is Preserve Existing Colors. When enabled, the macro skips faces that already have an assigned appearance. This helps protect manually assigned colors or existing custom appearances in the model.

The macro also includes a Reset Colors mode. When enabled, the macro does not apply new colors. Instead, it attempts to remove face-level appearance values from the solid bodies. This can be used to clean up or revert previously assigned face colors.

At the end of the operation, the macro generates an English summary report. The report includes total body count, processed body count, colored face count, skipped face count, reset face count, and failed face count.

More from Developer

View All
Tool
Tekla Structures Version Detector - Tekla Structures Tool | ZadaX Marketplace

Tekla Structures Version Detector

by miraç

6
Free
Addon
NWD Copier - Navisworks Addon | ZadaX Marketplace

NWD Copier

by miraç

5
Free
Tool
Tekla Structures\u002D .uel Version Viewer - Tekla Structures Tool | ZadaX Marketplace

Tekla Structures- .uel Version Viewer

by miraç

1
Free
Calculation Sheet
Bolt Weight Calculator \u002D Spreadsheet -  Calculation Sheet | ZadaX Marketplace

Bolt Weight Calculator - Spreadsheet

by miraç

21
Free
v2026.06.02.0938