Selecting Graphics Colours Automatically
- Last UpdatedFeb 19, 2025
- 3 minute read
Keywords
AUTOCOLOUR
Description
Lets the user define a set of rules for automating the selection of colours for items added to graphical views. Each rule consists of a set of selection criteria for particular types of element, together with an associated colour (which may be an explicit colour number or an expression).
When an element is added to the drawlist, the selection rules are scanned in sequence until a rule is found to be true for that element. The element is then added in the colour corresponding to that rule. If the colour is invalid, the search is continued. If no rule is true for the element, the default colour is used. The order in which the rules are set up is significant, since the first rule found to be true determines the colour.
Automatic colour selection may be switched on or off as required. If it is on, the colour specified by the rule is used rather than any other colour entered as part of the ADD command. If dynamic auto-colouring is specified, the auto-colour will be checked every time an attribute is changed and, if necessary, the relevant element will be re-added in the current colour.
Each autocolour may be drawn either as a solid colour (default) or as a translucent shade. If using translucency, the user can also specify whether or not the edges of an item should be drawn (as in wireline mode) to give a more distinct outline.
Examples |
|
|---|---|
|
AUTOCOLOUR ALL EQUI COLOUR 4 |
All Equipment items to be added in colour 4 |
|
AUTOCOLOUR ALL EQUI COLOUR 4 TRANSLUCENCY 25 EDGES ON |
All Equipment items to be added in colour 4 with 25% translucency and edges drawn. |
|
AUTOCOLOUR ALL BRAN WITH (HBORE GT 100) COLOUR 10 |
All Branches with head bores greater than 100 to be added in colour 10. |
|
AUTOCOLOUR ALL SCTN COLOUR (:COLOUR OF SPRE) |
All Sections to be added as defined by the UDA :COLOUR derived via their SpecRefs. |
|
AUTOCOLOUR ALL COLOUR (:COLOUR) |
Uses the UDA :COLOUR to denote the colour for all displayed elements. If the user enters this as the final rule, it will provide a default colour if all other rules prove false. |
|
AUTOCOLOUR ON |
Colours will be chosen according to autocolour rules. If Off (the default), colour specified in the ADD command will be used. |
|
AUTOCOLOUR DYNAMIC ON |
Updates autocolour each time an attribute changes. (Use with care!) |
|
AUTOCOLOUR RESET |
Clears all current autocolour rules. |
|
AUTOCOLOUR REMOVE 2 |
Removes the second rule from the current list. |
|
AUTOCOLOUR REORDER 2 TO 4 |
Moves rule number 2 to position 4 in the list. |
Command Syntax
>- AUTOCOLOUR -+- selection_rule - COLOUR - expression -+->
| |
| .-----------------------<--------------'
| |
| '- TRANSLucency - expression -+->
| |
| '- EDGES - ON/OFF ->
|- ON/OFF ->
|
|- DYNAMIC - ON/OFF ->
|
|- RESET ->
|
|- REMOVE - integer ->
|
‘- REORDER - integer1 - TO - integer2 ->
Note:
The expression for Translucency must be in the range 0‑99: the actual translucency will be set to the nearest of 12, 25, 37, 50, 62, 75 or
87
(99 = transparent; 0 = opaque).
AUTOCOLOUR ON must be in force to see the effect of AUTOCOLOUR DYNAMIC ON.
Querying
|
Q AUTOCOLOUR NUMber |
Gives number of colour rules. |
|---|---|
|
Q AUTOCOLOUR MODE |
Queries autocolour mode: On or Off. |
|
Q AUTOCOLOUR integer |
Gives selection criteria for rule integer. |
|
Q AUTOCOLOUR DYNAMIC |
Checks whether dynamic updating is on or off. |
|
Q AUTOCOLOUR FOR id COLOUR |
Queries colour that would be selected for identified element (this is of most use for batch testing). |
|
Q AUTOCOLOUR FOR id TRANSLUCENCY |
Queries translucency setting for identified element. |
|
Q AUTOCOLOUR FOR id EDGES |
Queries whether or not edges are to be drawn for identified element (only relevant if translucency is being applied). |