GRAPHISOFT®

Python APIVersion: 0.23 Beta

SetElementProperty

Sets the specified property for the given value(s) on an element.

def SetElementProperty (elemGuid, property) -> None

 

Parameters

elemGuid
[in] GUID of an Element.
property
[in] An APIObject describing the Property to modify.

 

Return Values

This function does not have any return values.

 

Remarks

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

For information on how to fill the passed 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, GetElementProperty, AddElementProperty, DeleteElementProperty

All functions