From what I've been able to tell, generally, the APIName
of a property in an object's object.Properties
list corresponds to the name used to access that property directly from the object. In other words, to get the value of the property from a given index
of object.Properties
, this should work: getattr(object, object.Properties[index].APIName)
.
As an example, for a named selection, the second item in the object.Properties
list shows up as GeometrySelection
when you execute object.Properties[1]
, and 'Location'
is returned when you execute object.Properties[1].APIName
. So, object.Location
is equivalent to getattr(object, object.Properties[1].APIName)
. This can be useful since it allows the entirety of the properties for a given object to be obtained by the script without having to know ahead of time the means of getting a specific property.
However, there is at least one instance where this is not the case. For the "Optimization Region" of a "Structural Optimization" simulation, object.DesignRegionLocation
returns the scoped geometry for the region. However, the item that corresponds to that property is the third item from the object.Properties
list, and the APIName
is empty. As far as I can tell, there is no means of identifying the DesignRegionLocation
from the object.Properties
list. Am I missing something?