GRAPHISOFT®

Python APIVersion: 0.23 Beta

GetElementProperty

Retrieves the specified property definition's value from an element.

def GetElementProperty (elemGuid, defitionGuid) -> List (APIObject)

 

Parameters

elemGuid
[in] GUID of an Element.
defitionGuid
[in] GUID of a Property Definition.

 

Return Values

This function returns an APIObject describing the Property value of the given Property Defition for the given Element.

 

Remarks

This function is analogous to the ACAPI_Element_GetPropertyValue function of the C++ API.

For information on how to interpret the returned APIObject, visit the C++ documentation.

 

Example

# Set clicked element's properties to default
elem = ClickElement ()

with UndoScope ("Set Element Properties to Default"):
    for d in GetElementPropertyDefinitionDictionary (elem, API_PropertyDefinitionFilter_UserDefined).values ():
        if d.canValueBeEditable and d.defaultValue.hasExpression == False:
            p = GetElementProperty (elem, d.guid)
            if p.isDefault == False:
                p.isDefault = True
                SetElementProperty (elem, p)
                print("Changed \"{}\" property to it's default value.".format (d.name))

 

Requirements

Version: Python API 0.1 or Later
Module: GS

 

See Also

GetElementList
GetElementPropertyDefinitionDictionary, SetElementProperty, AddElementProperty, DeleteElementProperty

All functions