GRAPHISOFT®

Python APIVersion: 0.23 Beta

SearchAttributeByName

Searches for an attribute by name.

def SearchAttributeByName (typeID, name) -> APIObject

 

Parameters

typeID
[in] The type of the requested attribute. See API_AttrTypeID for available attribute types.
name
[in] The of the requested attribute.

 

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_Attribute_Search function of the C++ API.

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

 

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

GetAttributeDictionary, ModifyAttribute

All functions