<?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 ID and Properties via Python in Archicad Python API</title>
    <link>https://community.graphisoft.com/t5/Archicad-Python-API/ID-and-Properties-via-Python/m-p/631848#M1045</link>
    <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any way to get the information stored in an element's "ID and Properties" field via&amp;nbsp;&lt;STRONG&gt;Python's&amp;nbsp;&lt;/STRONG&gt;API?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="benjaminjamesrowley_1-1727072638986.png" style="width: 999px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/76791iE38809E89B61F39E/image-size/large?v=v2&amp;amp;px=999" role="button" title="benjaminjamesrowley_1-1727072638986.png" alt="benjaminjamesrowley_1-1727072638986.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried treating it as any other property and accessing it via either&amp;nbsp;&lt;SPAN&gt;GetBuiltInPropertyId() or&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;GetUserDefinedPropertyId()&lt;/SPAN&gt;&lt;SPAN&gt;, but no luck. It doesn't seem to work like "normal" properties.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I found &lt;A href="https://community.graphisoft.com/t5/Archicad-C-API/Get-element-s-ID/td-p/369035" target="_self"&gt;this&lt;/A&gt; discussion on the C++ forum, but I can't seem to apply it to Python.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Sep 2024 19:15:39 GMT</pubDate>
    <dc:creator>benjaminjamesrowley</dc:creator>
    <dc:date>2024-09-23T19:15:39Z</dc:date>
    <item>
      <title>ID and Properties via Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/ID-and-Properties-via-Python/m-p/631848#M1045</link>
      <description>&lt;P&gt;Hello everyone,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any way to get the information stored in an element's "ID and Properties" field via&amp;nbsp;&lt;STRONG&gt;Python's&amp;nbsp;&lt;/STRONG&gt;API?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="benjaminjamesrowley_1-1727072638986.png" style="width: 999px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/76791iE38809E89B61F39E/image-size/large?v=v2&amp;amp;px=999" role="button" title="benjaminjamesrowley_1-1727072638986.png" alt="benjaminjamesrowley_1-1727072638986.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried treating it as any other property and accessing it via either&amp;nbsp;&lt;SPAN&gt;GetBuiltInPropertyId() or&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;GetUserDefinedPropertyId()&lt;/SPAN&gt;&lt;SPAN&gt;, but no luck. It doesn't seem to work like "normal" properties.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I found &lt;A href="https://community.graphisoft.com/t5/Archicad-C-API/Get-element-s-ID/td-p/369035" target="_self"&gt;this&lt;/A&gt; discussion on the C++ forum, but I can't seem to apply it to Python.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2024 19:15:39 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/ID-and-Properties-via-Python/m-p/631848#M1045</guid>
      <dc:creator>benjaminjamesrowley</dc:creator>
      <dc:date>2024-09-23T19:15:39Z</dc:date>
    </item>
    <item>
      <title>Re: ID and Properties via Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/ID-and-Properties-via-Python/m-p/631850#M1046</link>
      <description>&lt;P&gt;Hi!&lt;BR /&gt;&lt;BR /&gt;It should work with &lt;STRONG&gt;GetBuiltInPropertyID&lt;/STRONG&gt;. Where did you get stuck?&lt;BR /&gt;&lt;BR /&gt;Here's a commented example script I adapted from one of my other examples:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;###############################################################################
#                              0. GENERAL SETUP                               #
###############################################################################
from archicad import ACConnection

# Connect to a running Archicad instance
conn = ACConnection.connect()
assert conn, 'Communication Link is not available - timed out'

# Definitions for shorter access to API functionality
acc = conn.commands
act = conn.types
acu = conn.utilities


###############################################################################
#                            1. List of Zone GUIDs                            #
###############################################################################
# Get all zones from the open Archicad Plan
zoneElems = acc.GetElementsByType('Zone')

# Make a list of Zone GUIDs from the list of zones
# (`.elementId` is a very confusing choice of name for the zone's GUID here.
#  Don't confuse it with the Zones actual Element ID!)
zoneGuids = [zone.elementId for zone in zoneElems]


###############################################################################
#                           2. Element IDs of Zones                           #
###############################################################################
# Get the ID for the built in property representing the Element Id
elemIdPropId = acu.GetBuiltInPropertyId('General_ElementID')

# Now obtain the actual Element ID of each zone
zoneElementIdValues = acc.GetPropertyValuesOfElements(zoneGuids, [elemIdPropId])


###############################################################################
#             3. Ouptut Zone GUIDs and Element IDs of Zones                   #
###############################################################################

# Now we iterate over both the zone GUIDs and Element ID property values which
# we obtained in step 2.
for zoneGuid, elemProp in zip(zoneGuids, zoneElementIdValues):

    # The actual property value is a bit nested inside the result of step 2.
    # (Detail: We can assume that there's only one value and thus use the 1st
    #  element with index 0, since we passed only one Property Id to
    #  `GetPropertyValuesOfElements` in step 2).
    print(zoneGuid, elemProp.propertyValues[0].propertyValue.value)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Let me know if you have any questions about it!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Bernd&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2024 18:09:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/ID-and-Properties-via-Python/m-p/631850#M1046</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2024-09-23T18:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: ID and Properties via Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/ID-and-Properties-via-Python/m-p/631876#M1047</link>
      <description>&lt;P&gt;Hi Bernd,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your quick and detailed reply. I have since had a adjust your script to fit mine, and I'm pleased to say it works perfectly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem was that I didn't know the Build In Property Name was&amp;nbsp;&lt;SPAN&gt;General_ElementID. I ran&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;GetAllPropertyNames&lt;/SPAN&gt;&lt;SPAN&gt;() and then looked for "ID and Properties".&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks again,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Benjamin&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Sep 2024 09:34:57 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/ID-and-Properties-via-Python/m-p/631876#M1047</guid>
      <dc:creator>benjaminjamesrowley</dc:creator>
      <dc:date>2024-09-23T09:34:57Z</dc:date>
    </item>
  </channel>
</rss>

