set_color
Set the color of active SOLIDWORKS parts or assembly components using color names, hex, or RGB values with optional transparency. The tool reports the color read back for each target.
Instructions
Set the colour of the active part, or of components of the active assembly. On a part the colour is stored in the part, so every assembly using it shows it (save the part to keep it). On an assembly, give components (names, or paths into sub-assemblies such as 'Door-1/Slat-3'; a list does several at once): the colour is stored in the assembly and the part files stay unchanged. Colour as a name (red, green, blue, yellow, orange, purple, cyan, magenta, pink, brown, white, black, grey, light_grey, dark_grey, silver, gold), hex '#rrggbb', or rgb [r, g, b] with 0 to 255 each; transparency from 0 (solid) to 1 is optional. Reports the colour read back for each target.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "set_color"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rgb | No | Instead of color: [r, g, b], each 0 to 255 | |
| color | No | Colour name or hex value '#rrggbb' | |
| component | No | In an assembly: one component, instead of the list | |
| components | No | In an assembly: the components to colour | |
| transparency | No | 0 = solid, 1 = invisible. Left as it is when not given. |