Managing Coloration of Nodes
Below we will consider the command that allows to set a color group to any model node. Color groups are stored in the property workspace.
Example of running the command with specifying color group ‘1’ for each UUID in a uuids
list (TypeScript):
view.runCommand({
name: "SetColorCommand",
groupIndex: 1,
uuids : uuids,
options: {
clean: true
branch: true
}
})
This command applies a color group with index groupIndex
to nodes specified with a list of UUIDs uuids
.
Data of each color group is stored in colors.groups
of workspace
property in the view settings.
In addition to the parameters above there are also the following options:
options.clean
: cleaning up colors (groupIndex
values of all nodes with them different from ‘0’ will be set to ‘0’).options.branch
: applying a color group for all branches containing a UUID.
This command doesn’t return anything as a result.
Note
Pay attention that this command only applies a colors.groups
data to nodes and doesn’t change it on its own.
To get known of how to change colors.groups
data, see sections Setting Parameters and Property ‘Workspace’.