Integrations (PTC products, 3rd party products and code) > Code integration (Ada, ARINC 653, C, C#, C++, IDL, Java, SQL and VB) > System generation for simulation - C, C++ and Java code > System simulation > Simulating a system > Setting or reading the value of an attribute (system simulation)
  
Setting or reading the value of an attribute (system simulation)
You can set and read the values of attributes.
To set the value of an attribute:
1. Select the instance diagram associated with the instance of the Class for which you want to set the attribute value.
2. On the State Simulation toolbar, click the Show Inject/Query Dialog button.
3. On the Attributes drop-down list box, select the Attribute you want to set.
4. In the Attribute text box, type or select the value you want to set.
5. Click Set.
Note that if you are setting an Attribute to meet a condition defined in a Change trigger, you must inject an Event into the state machine so that the condition is tested by the Run To Completion Operation. If you want to call the Run To Completion Operation without injecting an Event of any significance, inject an <Idle> Event.
To read the value of an attribute:
1. Select the instance diagram associated with the instance of the Class for which you want to read the attribute value.
2. On the State Simulation toolbar, click the Show Inject/Query Dialog button.
3. On the Attributes drop-down list box, select the Attribute you want to read.
4. Click Get.
The value of the selected Attribute is displayed in the Attributes text box.
* 
The displayed value is not updated as that value changes.