We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2023-02-18 10:09 AM
Hello,
GetLayerCombinationAttributes returns a list of Combinations each with
How can we fetch the status of the layers specific of each combination?
Running GetLayerAttributes on the list of layers just return the ACTIVE combination's layer status.
I am certainly missing something:
from archicad import ACConnection
conn = ACConnection.connect()
assert conn
acc = conn.commands
layCombList = acc.GetLayerCombinationAttributes(acc.GetAttributesByType("LayerCombination"))
# LayerCombinationAttributeWrapper {'layerCombinationAttribute': {
# 'attributeId': {'guid': '4B57CB36-174B-1D4A-B757-1E5C57754EB5'},
# 'name': '31 Beispiel GR Exposé',
# 'layerAttributeIds': [{'attributeId': {'guid': '3980C7AB-067C-4A46-ABE5-F74AF487F348'}}, ... list of layer guids
for comb in layCombList:
print(f"{comb.layerCombinationAttribute.attributeId.guid}\t{comb.layerCombinationAttribute.name}")
layList = comb.layerCombinationAttribute.layerAttributeIds # list of layer IDs
layAttrs = acc.GetLayerAttributes(layList)
print(layAttrs[0])
# below the attributes of ARCHICAD layer in the ACTIVE layer combination!!!
# how do I fetch the attributes according to the layer combination?
# LayerAttributeWrapper {'layerAttribute': {
# 'attributeId': {'guid': '3980C7AB-067C-4A46-ABE5-F74AF487F348'},
# 'name': 'Archicad-Ebene', 'intersectionGroupNr': 1,
# 'isLocked': False,
# 'isHidden': False,
# 'isWireframe': False}}
2023-02-18 12:19 PM
You are not clear in what you are asking for? Or perhaps, it is just me.
Do you want the layer attributes for the layers within the active layer combination or the layer attributes for layers within a specific layer combination? Your script already shows that info.
The Python API does not know which layer combination is the active one -- AFAIK
2023-02-18 02:57 PM - edited 2023-02-18 02:59 PM
Hello Gerry,
a layer combination stores different status sets for each layer guid.
ARCHICAD layer, for example, could be visible in one combination and invisible in another.
GetLayerCombinationAttributes just returns the list of names plus the list of layers in the document by guid (which is weird, since this repeats identical for each layer combination).
There is no way that I can see to fetch the particular status of each layer in a combination.
In the API there would be API_LayerStat: https://archicadapi.graphisoft.com/documentation/api_layerstat
I would have expected GetLayerCombinationAttributes to return:
Do you see a method to fetch these?
2023-02-18 08:39 PM
I am still puzzled because the last line in your code does exactly that.
As I Understand: All layers belong to all combinations. The combination layer then sets the attributes for the layers within it (all of them) using the 'update' command. The GetLayerCombinationAttributes() command returns all attributes for a Combination including the the layer guids. The layer status for each layer can be retrieved using the guid for that layer. To retrieve a particular layer you would need to retrieve all of the layers and filter for the particular layer name you want.
The problem is that GetLayerAttributes() only returns the current set of attributes for the layer, as set, not what would be set if a particular combination is used. This become even more confusing if a custom set is used.
As mentioned, only the C++API can address this issue.
2023-02-19 04:49 AM - edited 2023-02-19 04:49 AM
Thank you, so again this can't be done.
To resume this puzzling issue: GetLayerCombinationAttributes just returns a list of combination names, no more.
As information it is really very limited.
I hoped to be able at least to store the status of each layer within each combination as text file or excel for easier comparison.