<?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: Selecting elements with Python in Archicad Python API</title>
    <link>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/373394#M774</link>
    <description>&lt;P&gt;can you please provide the website? I can't find videos on&amp;nbsp;&lt;A href="https://graphisoft.com/downloads/python" target="_blank"&gt;https://graphisoft.com/downloads/python&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Mar 2023 15:11:26 GMT</pubDate>
    <dc:creator>noriksaroyan</dc:creator>
    <dc:date>2023-03-16T15:11:26Z</dc:date>
    <item>
      <title>Selecting elements with Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238178#M760</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;Hey,&lt;BR /&gt;is there an easy way to get all Zone elements in the same classification system or all walls in the same branch?&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Sep 2021 11:34:47 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238178#M760</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-14T11:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting elements with Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238179#M761</link>
      <description>You can get the wall and zone elements by using the function: GetElementsByType(Zone or Wall)&lt;BR /&gt;
Use GetClassificationsOfElements() to get the classifications of each of the above elements.&lt;BR /&gt;
&lt;BR /&gt;
You will then have to iterate through the list to isolate the elements with the desired classification.&lt;BR /&gt;
&lt;BR /&gt;
There is no direct method but the above is only a few lines</description>
      <pubDate>Tue, 19 Jan 2021 05:45:09 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238179#M761</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2021-01-19T05:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting elements with Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238180#M762</link>
      <description>I guess code like this:&lt;BR /&gt;
------------------------------------------------------------------------
&lt;PRE&gt;from archicad import ACConnection
conn = ACConnection.connect()       #连接AC Application对象
assert conn
acc = conn.commands                 #赋值acc为AC的commands命令对象
act = conn.types                    #赋值act为AC的types类型对象
acu = conn.utilities                #赋值act为AC的utility实用工具对象

lstElements1 = acc.GetElementsByType("Zone")
and then? how to use GetClassificationsOfElements,can you give a code example?
like foreach item in lstElements1 :&lt;/PRE&gt;
    .....&lt;BR /&gt;
    ......</description>
      <pubDate>Tue, 19 Jan 2021 08:33:47 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238180#M762</guid>
      <dc:creator>Boling1</dc:creator>
      <dc:date>2021-01-19T08:33:47Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting elements with Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238181#M763</link>
      <description>Sorry -- Picked the wrong function!!&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;space_classification_item = acu.FindClassificationItemInSystem( 'ARCHICAD Classification', 'Space')

element_ids = acc.GetElementsByClassification(space_classification_item.classificationItemId)
print(element_ids)&lt;/PRE&gt;

&lt;BR /&gt;
Once you have your element list, you can iterate through to find the element with the properties you want or match them to a specific element type?</description>
      <pubDate>Tue, 19 Jan 2021 14:23:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238181#M763</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2021-01-19T14:23:34Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting elements with Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238182#M764</link>
      <description>It is possible to find just elements with Archicad Classification (root system)?</description>
      <pubDate>Tue, 19 Jan 2021 17:08:50 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238182#M764</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-01-19T17:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting elements with Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238183#M765</link>
      <description>You are not clear as to what information you want based on classification? Are you seeking a list of element identifiers (guid), ids (names) ,or types, etc.?&lt;BR /&gt;
&lt;BR /&gt;
The Archicad classification system is a tree structure with a root (system) name at the top and a item id (s) which may be branches, sub-branches or leaves. &lt;BR /&gt;
&lt;BR /&gt;
Elements are classified based on the classification  system name (root) and a item id which could be a branch, sub-branch or leaf name. You need both names (system &amp;amp; item) to retrieve a element Id. This is because there can be several different classification systems in Archicad with duplicate item names between each. How  you retrieve a element depends on how it was classified in the "classifications and Properties" Tab. Elements can be classified at any level and by multiple class system structures. &lt;BR /&gt;
&lt;BR /&gt;
Using: "GetElementsByClassification" returns a list of elements (guids) that have that classification.You then can use other functions to find or sort through the properties of each element.</description>
      <pubDate>Tue, 19 Jan 2021 18:12:33 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238183#M765</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2021-01-19T18:12:33Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting elements with Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238184#M766</link>
      <description>sorry I'm new in Python, I  runned &lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;space_classification_item = acu.FindClassificationItemInSystem( "ARCHICAD Classification", "Wall")&lt;/PRE&gt;

&lt;BR /&gt;
&lt;BR /&gt;
and the result is :&lt;BR /&gt;
&lt;BR /&gt;
Exception has occurred: StopIteration&lt;BR /&gt;
  File "C:\software\Python\Excel file exporter\toExcel-1.py", line 27, in &amp;lt;module&amp;gt;&lt;BR /&gt;
    space_classification_item = acu.FindClassificationItemInSystem("RCHICAD Classification", "Wall")&lt;BR /&gt;
&lt;BR /&gt;
1&amp;gt;"ARCHICAD Classification" 'ARCHICAD Classification' which is right?&lt;BR /&gt;
2&amp;gt;Wall Column Beam Window Door Object Lamp Slab Roof Mesh Zone CurtainWall Shell Skylight Morph Stair Railing Opening, I don't know what "Space" means?&lt;BR /&gt;
3&amp;gt;Can you give a whole code, if I can run that code, I can get what you mean.&lt;BR /&gt;
&lt;BR /&gt;
thx a lot</description>
      <pubDate>Fri, 22 Jan 2021 09:13:45 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238184#M766</guid>
      <dc:creator>Boling1</dc:creator>
      <dc:date>2021-01-22T09:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting elements with Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238185#M767</link>
      <description>You are not clear as to what information you want based on classification? Are you seeking a list of element identifiers (guid), ids (names) ,or types, etc.? What information do you want to do what?</description>
      <pubDate>Fri, 22 Jan 2021 12:56:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238185#M767</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2021-01-22T12:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting elements with Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238186#M768</link>
      <description>I just want to takeoff all walls's area,thickness,story_number,building_material,How can I do by python?</description>
      <pubDate>Tue, 26 Jan 2021 13:49:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238186#M768</guid>
      <dc:creator>Boling1</dc:creator>
      <dc:date>2021-01-26T13:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting elements with Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238187#M769</link>
      <description>You might start by reviewing the videos and examples on Graphisoft's Python site.&lt;BR /&gt;
&lt;BR /&gt;
For wall properties, the procedure is to obtain the IDs of both the element (wall) and the property, then use the Get Value function to obtain the property value. Story level and Building Material are not directly available but can be obtained by making a custom expression property referencing those properties, Then reference the custom properties.&lt;BR /&gt;
&lt;BR /&gt;
The examples illustrate this.</description>
      <pubDate>Tue, 26 Jan 2021 16:01:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238187#M769</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2021-01-26T16:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting elements with Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238188#M770</link>
      <description>I have read all the phthon examples,but I can't find any info about story_namber and building_material,can you figer out   which example I should read carefully? &lt;BR /&gt;
thx a lot</description>
      <pubDate>Thu, 28 Jan 2021 06:58:09 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238188#M770</guid>
      <dc:creator>Boling1</dc:creator>
      <dc:date>2021-01-28T06:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting elements with Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238189#M771</link>
      <description>&lt;BLOCKQUOTE&gt;poco2013 wrote:&lt;BR /&gt;
Sorry -- Picked the wrong function!!&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;space_classification_item = acu.FindClassificationItemInSystem( 'ARCHICAD Classification', 'Space')

element_ids = acc.GetElementsByClassification(space_classification_item.classificationItemId)
print(element_ids)&lt;/PRE&gt;

&lt;BR /&gt;
Once you have your element list, you can iterate through to find the element with the properties you want or match them to a specific element type?
&lt;/BLOCKQUOTE&gt;

&lt;BR /&gt;
Hi, just curious if you have already tried to SetClassificationsOfElements, as this somehow tricking me at the moment. It requires the list of ElementClassification but I somehow don't get it right. Any help is appreciated!</description>
      <pubDate>Tue, 02 Feb 2021 12:46:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238189#M771</guid>
      <dc:creator>JSN</dc:creator>
      <dc:date>2021-02-02T12:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting elements with Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238190#M772</link>
      <description>Might be a easier way:&lt;BR /&gt;

&lt;PRE&gt;elements = acc.GetElementsByType('Object')
top_class = acu.FindClassificationSystem('ARCHICAD Classification')
item_class = acu.FindClassificationItemInSystem('ARCHICAD Classification','System Furniture')
class_id = act.ClassificationId(top_class,item_class.classificationItemId)
elem_classes = []
for element in elements:
    elem_class = act.ElementClassification(element.elementId,class_id)
    elem_classes.append(elem_class)
acc.SetClassificationsOfElements(elem_classes)&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 Feb 2021 15:13:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238190#M772</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2021-02-02T15:13:03Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting elements with Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238191#M773</link>
      <description>&lt;BLOCKQUOTE&gt;poco2013 wrote:&lt;BR /&gt;
Might be a easier way:
&lt;/BLOCKQUOTE&gt;

Thx, structuring the class hierarchy helps. I will dig deeper and see where I get with this!</description>
      <pubDate>Tue, 02 Feb 2021 17:03:29 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/238191#M773</guid>
      <dc:creator>JSN</dc:creator>
      <dc:date>2021-02-02T17:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting elements with Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/373394#M774</link>
      <description>&lt;P&gt;can you please provide the website? I can't find videos on&amp;nbsp;&lt;A href="https://graphisoft.com/downloads/python" target="_blank"&gt;https://graphisoft.com/downloads/python&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 15:11:26 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/373394#M774</guid>
      <dc:creator>noriksaroyan</dc:creator>
      <dc:date>2023-03-16T15:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting elements with Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/373395#M775</link>
      <description>&lt;P&gt;The link to the videos are in the PDF of each script examples.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NB: I made a little introduction to the archicad/python connection here if you are a beginner on the subject: &lt;A href="https://community.graphisoft.com/t5/Developer-forum/PYTHON-Introduction-to-the-Archicad-Python-connection/td-p/371839" target="_blank"&gt;https://community.graphisoft.com/t5/Developer-forum/PYTHON-Introduction-to-the-Archicad-Python-connection/td-p/371839&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 15:24:20 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/373395#M775</guid>
      <dc:creator>Mathias Jonathan</dc:creator>
      <dc:date>2023-03-16T15:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting elements with Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/373398#M776</link>
      <description>&lt;P&gt;Thank you, Mathias.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have another question here:&amp;nbsp;&lt;A href="https://community.graphisoft.com/t5/Developer-forum/Getting-all-property-values-of-type-Door-from-Archicad-26/td-p/373353" target="_blank"&gt;https://community.graphisoft.com/t5/Developer-forum/Getting-all-property-values-of-type-Door-from-Archicad-26/td-p/373353&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;would appreciate any kind of help))&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 16:33:06 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Selecting-elements-with-Python/m-p/373398#M776</guid>
      <dc:creator>noriksaroyan</dc:creator>
      <dc:date>2023-03-16T16:33:06Z</dc:date>
    </item>
  </channel>
</rss>

