Language Reference Guide : 4. System Classes : Object Class : SetAttribute Method
 
Share this page                  
SetAttribute Method
The SetAttribute method sets any number of attributes for the object.
This method has the following syntax:
integer = Object.SetAttribute(attributename = value
          {, attributename = value})
This method has the following parameters:
attributename
Specifies the attribute whose value you want to set
value
Specifies the variable into which you place the attribute's value
If all the attributes exist and no other errors are found, the method returns ER_OK (or zero). If any of the attributes do not exist for the object, the method returns a non-zero value (although no error message is generated and the attributes that do exist will be set). If there is a data type mismatch between the attribute and its assigned value, the method returns a non-zero value and an error message. Descriptions of system constant values and their numeric equivalents are listed in Error Codes.
This method is useful for setting attributes for a group of dissimilar objects, as OpenROAD does in Workbench's Frame Editor. For example, if you select a set of fields and a font, the system sends SetAttribute (TypeFace = value) to all the objects. Any objects that have the TypeFace attribute act on it, while any that do not silently ignore it.
In general it is more efficient to set attributes directly rather than using the SetAttribute method.