GRAPHISOFT®

Python APIVersion: 0.23 Beta

ChangeElementHeader

Changes the header of an element, which contains the main informations of the element (layer, floor index, renovation info etc.).

def ChangeElementHeader (elemHead) -> String

 

Parameters

elemHead
[in] An APIObject describing the modified element informations. It's identified by GUID.

 

Return Values

This function returns the GUID of the modified element.

 

Remarks

For information on how to fill the passed elemHead APIObject, visit the documentation of API_Elem_Head structure.

 

Example

# Move all morphs to the "Morph - General" layer
morphLayer = SearchAttributeByName(API_LayerID, "Morph - General")
count = 0

with UndoScope("Changing Layer of Morphs"):
    for morphGuid in GetElementList(API_MorphID):
        morphHeader = GetElementHeader(morphGuid)
        if morphHeader.layer != morphLayer.index:
            morphHeader.layer = morphLayer.index
            ChangeElementHeader(morphHeader)
            count += 1

print("Changed {} Morph(s)".format (count))

 

Requirements

Version: Python API 0.1 or Later
Module: GS

 

See Also

GetElementHeader, GetElementList

All functions