To refer to the name of an item:
the name [local-name] of item->symbol
the quantifier, this generic reference expression produces the first symbol in the Names attribute of the specified item. With the any quantifier, this expression produces the set of symbols that name the specified item. For example:
if the name of the custom-object O nearest to help-button is custom
then conclude that the status of O is OK
To refer to the class of an item:
the class of item->symbol
if the class of the custom-object O nearest to help-button is my-object
then conclude that the status of O is ok
To refer to an item that is an instance of a particular class:
item is an instance of the class named by (symbolic-expression)->truth-value
if the custom-object O nearest to help-button is an instance of the class
named by (the equipment-class-identifier of my-object) then
conclude that the status of O is ok
To refer to the item superior to a workspace:
the class-name [local-name] superior to kb-workspace->item
move the item superior to this workspace by (100,100)
for any kb-workspace W
if the custom-object O superior to W exists and the name of W is help
then conclude that the purpose of O is help-schematic
if rule identifies each workspace that has a superior item and, for each that does and whose name also is help, sets the Purpose attribute of its superior item to the symbol help-schematic.
To refer to the object superior to an object contained in an attribute:
the class-name [local-name] superior to object->object
rotate the object superior to my-custom-object
exists expression, as follows:
for any custom-object O1
if the object O2 superior to O1 exists and the name of O2 is help
then conclude that the status of O2 is ok
if rule identifies each custom-object that has superior item and, for each that does and whose name also is help, sets its Status attribute to the symbol ok.
Referring to The Relationships of an Item
Each item contains information about the relationships in which it is participating. Such knowledge is not visible in an attribute table, but can be obtained programmatically.
To refer to the relationships of an item:
the relationships of item-of-interest->relationships: sequence
| Argument | Description |
|---|---|
item-of-interest
|
The item whose relationships you wish to obtain.
|
| Return Value | Description |
|---|---|
relationships
|
A sequence of structures of one or more relation names and the items to which it applies.
|
Each structure in relationships contains these subattributes:
married-to and a-son-of, you could create relations between objects with the following conclude actions:
conclude that bill is married-to edna
conclude that george is a-son-of edna
edna having two relationships with two separate objects, bill and george. A reference to:
the relationships of edna
![]() |
If an item is not participating in any relationships, G2 returns the symbol
none. Referring to The Size of an Item
To refer to the height of an item:
the item-height of item->integer
conclude that the height of my-object = the item-height of my-object
To refer to the width of an item:
the item-width of item->integer
conclude that the width of my-object = the item-width of my-object
To refer to the degrees of rotation of an item's representation:
the icon-heading of item->integer
conclude that the angle-of-rotation of my-object = the icon-heading
of my-object
rotate action in rotate.
Referring to the Position of an Item
To refer to the item-x-position of an item:
the item-x-position of item->integer
conclude that the horizontal-location of my-object = the item-x-position
of my-object
To refer to the item-y-position of an item:
the item-y-position of item->integer
conclude that the vertical-location of my-object = the item-y-position
of my-object
To refer to the item nearest to another item:
the class-name [local-name] nearest to item->item
the quantifier or the any quantifier, this generic reference expression produces the one item of the specified class (or any of its subclasses) that is on the same workspace as, and the fewest workspace units from, the specified item. The two specified items need not be connected. G2 calculates the proximity of a pair of items as the distance in workspace units between the centers of their respective representations. In the following example, the readout table indicates that item
B is nearest to item C, even though the top edge of the rule appears nearer to the item B than the left edge of item C.
![]() |
To refer to the distance between items:
the distance between item and {item | the nearest class-name}
-> nteger
The next figure shows two readout tables that use this expression to display the distance between items X and Y and between items X and Z.
![]() |