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:
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.