GRAPHISOFT®

Python APIVersion: 0.23 Beta

CreateElementGroup

Creates a new group from the given elements.

def CreateElementGroup (elemGuidList) -> String

 

Parameters

elemGuidList
[in] List of element GUIDs.

 

Return Values

This function returns the GUID of the created Group.

 

Remarks

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

 

Example

# Group morphs with similar material
morphDict = dict()

for morphGuid in GetElementList(API_MorphID):
    morph = GetElement(morphGuid)
    material = morph[0].material.attributeIndex
    if material not in morphDict:
        morphDict[material] = list()
    morphDict[material].append(morphGuid)

with UndoScope("Create Groups for Morphs"):
    for similarMorphs in morphDict.values():
        CreateElementGroup(similarMorphs)

print("{} Groups Created".format (len (morphDict.values())))

 

Requirements

Version: Python API 0.1 or Later
Module: GS

 

See Also

GetGroupedElements, GetGroupOfElement

All functions