element
change action does not make permanent changes; the effects of the actions are undone when you reset G2. In some cases, you can make these changes permanent by using the make permanent action, as described under make.
You can also make many permanent changes by using the conclude action, as described under conclude, in conjunction with attribute access, as described in Chapter 12, Attribute Access Facility.
Changing List and Array Elements
Using the change action with lists and arrays is described in Using Other List and Array Expressions.
Changing the Color Attribute of an Item
To change the color of an item:
change the color-attribute-name of item to {color-name | symbolic-expression}change the color-pattern of item so that
stripe-color color attribute. Workspaces and messages have a background-color, while messages and textual items, such as rules, have a text-color. Two versions of this action exist. The first lets you change a single color-attribute, the second,
change the color-pattern of, lets you change more than one color-attribute of an item in one statement. These examples show you how to change a single color-attribute, and then two attributes, using the
color-pattern of statement:
![]() |
If you try to change multiple icon regions by using the
change the color-pattern action, and a specified icon region does not exist, G2 signals an error. Changing the Icon Color Region of Instances
The change the icon-color of action changes any region of a system- or user-defined region called icon-color. icon-color. You can use the color operations system procedures to get a list of all region names and their corresponding colors, and then change them. The color operations system procedures are described in the G2 System Procedures Reference Manual.
To change an icon's icon-color region:
change the icon-color of object to color
Changing the Color of any Named Icon Region
You can change the color of any named icon region. Icon regions are described in Defining Regions.
To change the color of an icon region:
change the region-name icon-color of object to color-name
icon-color. This example changes the region called inner-circle of the object instance circle1 to green:
![]() |
Use the color operations system procedures, described in the G2 System Procedures Reference Manual to change multiple icon regions programmatically.
Changing the Name of an Item
Use this action to give an item a new Names attribute value and to replace any existing values. change the name of action to generate names for transient items.
To change the name of an item:
change the name of item to symbolic-expression
![]() |
Note: The Names attribute requires a symbolic value, so you must precede the item name using the symbol statement.
You can also use attribute access to reference and change most attribute values, as described in Chapter 12, Attribute Access Facility.
Minimizing the Size of a Workspace
Use this action to shrink wrap a workspace, which you refer to with any kb-workspace expression.
To change the size of a workspace to its minimum size:
change the size of kb-workspace to minimum
![]() |
Changing the Text of an Attribute
Note: In most cases, the attribute access facility supersedes the use of the change the text of action. However, all such actions continue to be supported. Attribute access is described in Chapter 12, Attribute Access Facility.
Use this action to change the value of any user-defined attribute and most system-defined attributes that you would otherwise change interactively with the Text Editor.
To change the text of an item's attribute:
change the text of the attribute of item to text-expression
Some examples follow. The first example changes the class name of an object definition. Making such a change updates all instances automatically. The second example first changes the attribute displays of the
automobile class definition and then changes the text of the change attribute of that definition to update all instances with the first change.
![]() |
Note: You cannot use this action to change the attribute values of tabular functions.
Use the make permanent action to make a change the text of action permanent. To make permanent changes to user-defined value attributes, use the conclude action, described on Concluding Attribute Values. For information about changing class definitions while G2 is running, see Changing Definitions.
Changing the Text of Textual Items
Use this change the text of action any time you wish to change any textual item programmatically.
To change the text of a procedure, statement, free-text, or message:
change the text of {procedure | statement | free-text | message} to text-expression
An example of changing the text of a message is:
![]() |