getAttribute

Syntax

<Path>.getAttribute(AttributeName:string[, byRef Inherited:boolean, byRef CanInherit:boolean]) → any

The method getAttribute returns the value of an attribute of the object designated by <Path>.

Parameters

  • The parameter AttributeName of data type string designates the value of the attribute.

  • When a local variable of data type boolean is passed to the optional parameter Inherited, Plant Simulation assigns true to this variable if the attribute designated by string inherits its value, false if it does not inherit the value.

    In case an attribute cannot be inherited, the optional parameter Inherited always returns false.

  • When a local variable of data type boolean is passed to the optional parameter CanInherit, Plant Simulation assigns true to this variable if the value of the attribute designated by string can be inherited, false if it cannot be inherited.

Return Value

The return value has the data type any.

Example

print MyStation.getAttribute("ProcTime")
-- checks if inheritance of the attribute 'Accumulating' is active or not
var inherited: boolean
print MyConveyor.getAttribute("Accumulating", inherited)
print inherited
var inherited:boolean
getAttribute("ShowObjectNames", inherited)
print "This setting of the Frame is inherited: ", inherited
var bInherits:boolean
getAttribute("Program", bInherits)

Related Topics

Inheritance

getSubAttribute

Inherit Source Code

putAttributeNamesIntoTable

setAttribute

setSubAttribute

isNameUnique

getAttribute in 3D