<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: GetLayerCombinationAttributes, how do I fetch the layer attributes specific of the combination? in Archicad Python API</title>
    <link>https://community.graphisoft.com/t5/Archicad-Python-API/GetLayerCombinationAttributes-how-do-I-fetch-the-layer/m-p/370971#M316</link>
    <description>&lt;P&gt;Hello Gerry,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;a layer combination stores different status sets for each layer guid.&lt;/P&gt;&lt;P&gt;ARCHICAD layer, for example, could be visible in one combination and invisible in another.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;GetLayerCombinationAttributes &lt;/STRONG&gt;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).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is no way that I can see to fetch the particular status of each layer in a combination.&lt;/P&gt;&lt;P&gt;In the API there would be API_LayerStat:&amp;nbsp;&lt;A href="https://archicadapi.graphisoft.com/documentation/api_layerstat" target="_blank" rel="noopener"&gt;https://archicadapi.graphisoft.com/documentation/api_layerstat&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would have expected&amp;nbsp;&lt;STRONG&gt;GetLayerCombinationAttributes&lt;/STRONG&gt; to return:&lt;/P&gt;&lt;DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;intersectionGroupNr&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;isLocked&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;isHidden&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;isWireframe&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;FONT face="inherit"&gt;Do you see a method to&amp;nbsp;&lt;/FONT&gt;fetch these?&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Sat, 18 Feb 2023 13:59:07 GMT</pubDate>
    <dc:creator>_c_</dc:creator>
    <dc:date>2023-02-18T13:59:07Z</dc:date>
    <item>
      <title>GetLayerCombinationAttributes, how do I fetch the layer attributes specific of the combination?</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/GetLayerCombinationAttributes-how-do-I-fetch-the-layer/m-p/370953#M314</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="inherit"&gt;&lt;STRONG&gt;GetLayerCombinationAttributes&lt;/STRONG&gt; returns a list of Combinations&amp;nbsp;&lt;/FONT&gt;each&lt;FONT face="inherit"&gt;&amp;nbsp;with &lt;/FONT&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;FONT face="inherit"&gt;guid&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="inherit"&gt;name&lt;/FONT&gt;&lt;/LI&gt;&lt;LI&gt;&lt;FONT face="inherit"&gt;list of layers' guid in the document&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;FONT face="inherit"&gt;How can we fetch the status of the layers specific of each combination?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="inherit"&gt;Running&amp;nbsp;&lt;/FONT&gt;&lt;SPAN&gt;&lt;STRONG&gt;GetLayerAttributes&lt;/STRONG&gt; on the list of layers just return the &lt;U&gt;ACTIVE&lt;/U&gt; combination's layer status.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am certainly missing something:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;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}}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Feb 2023 09:09:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/GetLayerCombinationAttributes-how-do-I-fetch-the-layer/m-p/370953#M314</guid>
      <dc:creator>_c_</dc:creator>
      <dc:date>2023-02-18T09:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: GetLayerCombinationAttributes, how do I fetch the layer attributes specific of the combination?</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/GetLayerCombinationAttributes-how-do-I-fetch-the-layer/m-p/370965#M315</link>
      <description>&lt;P&gt;You are not clear in what you are asking for? Or perhaps, it is just me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Python API does not know which layer combination is the active one -- AFAIK&lt;/P&gt;</description>
      <pubDate>Sat, 18 Feb 2023 11:19:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/GetLayerCombinationAttributes-how-do-I-fetch-the-layer/m-p/370965#M315</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2023-02-18T11:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: GetLayerCombinationAttributes, how do I fetch the layer attributes specific of the combination?</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/GetLayerCombinationAttributes-how-do-I-fetch-the-layer/m-p/370971#M316</link>
      <description>&lt;P&gt;Hello Gerry,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;a layer combination stores different status sets for each layer guid.&lt;/P&gt;&lt;P&gt;ARCHICAD layer, for example, could be visible in one combination and invisible in another.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;GetLayerCombinationAttributes &lt;/STRONG&gt;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).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is no way that I can see to fetch the particular status of each layer in a combination.&lt;/P&gt;&lt;P&gt;In the API there would be API_LayerStat:&amp;nbsp;&lt;A href="https://archicadapi.graphisoft.com/documentation/api_layerstat" target="_blank" rel="noopener"&gt;https://archicadapi.graphisoft.com/documentation/api_layerstat&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would have expected&amp;nbsp;&lt;STRONG&gt;GetLayerCombinationAttributes&lt;/STRONG&gt; to return:&lt;/P&gt;&lt;DIV&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;name&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;intersectionGroupNr&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;isLocked&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;isHidden&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;isWireframe&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;FONT face="inherit"&gt;Do you see a method to&amp;nbsp;&lt;/FONT&gt;fetch these?&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 18 Feb 2023 13:59:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/GetLayerCombinationAttributes-how-do-I-fetch-the-layer/m-p/370971#M316</guid>
      <dc:creator>_c_</dc:creator>
      <dc:date>2023-02-18T13:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: GetLayerCombinationAttributes, how do I fetch the layer attributes specific of the combination?</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/GetLayerCombinationAttributes-how-do-I-fetch-the-layer/m-p/370981#M317</link>
      <description>&lt;P&gt;I am still puzzled because the last line in your code does exactly that.&lt;/P&gt;
&lt;P&gt;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&amp;nbsp; 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. &lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As mentioned, only the C++API can address this issue.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Feb 2023 19:39:23 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/GetLayerCombinationAttributes-how-do-I-fetch-the-layer/m-p/370981#M317</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2023-02-18T19:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: GetLayerCombinationAttributes, how do I fetch the layer attributes specific of the combination?</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/GetLayerCombinationAttributes-how-do-I-fetch-the-layer/m-p/370991#M318</link>
      <description>&lt;P&gt;Thank you, so again this can't be done.&lt;/P&gt;&lt;P&gt;To resume this puzzling issue:&amp;nbsp;&lt;STRONG&gt;GetLayerCombinationAttributes&amp;nbsp;&lt;/STRONG&gt;just returns a list of combination names, no more.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As information it is really very limited.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Feb 2023 03:49:54 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/GetLayerCombinationAttributes-how-do-I-fetch-the-layer/m-p/370991#M318</guid>
      <dc:creator>_c_</dc:creator>
      <dc:date>2023-02-19T03:49:54Z</dc:date>
    </item>
  </channel>
</rss>

