| Prev | Next | Start of Chapter | End of Chapter | Contents | Index | (20 out of 25)

Set Attribute


The Set Attribute block sets the value of an attribute to the block's input data value. Specify the object whose attribute you would like to set by connecting the Set Attribute block's action link to it. You can connect the action link to any G2 object or block. Specify the attribute you would like to set by setting Target Attribute to its name.

When you connect a block to the Set Attribute block's action link, the configuration panel displays a list of all attributes defined by the connected block. Thus, you should always connect the Action Link to the target before configuring the block.

Take the following precautions when using the Set Attribute block:


Caution: When you use the Set Attribute block, be sure that the changes to the attribute value leave the target block in a valid state; otherwise, errors will result. For example, if you use the Set Attribute block to set the Upper Threshold of an observation block to a number that is less than the Lower Threshold, you will receive a warning and a runtime error might result.

Configuring

This is the configuration panel for the Set Attribute block.


Attribute Description
Target Attribute
An attribute of the block connected to the action link, whose value the Set Attribute block sets.

Example

The following figure uses the Set Attribute block to test whether the temperature of tank-2 is more than twice the temperature of tank-1:


See Also

For more information on how to use this block, see the sections below.

Click here for more information...
Basic Block Behavior
Editing Attribute Displays
Attribute Transfer

| Prev | Next | Start of Chapter | End of Chapter | Contents | Index | (20 out of 25)

Copyright © 1996, Gensym Corporation, Inc.