<?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 Getting &amp;quot;Show On Renovation Filter&amp;quot; parameter in Python in Archicad Python API</title>
    <link>https://community.graphisoft.com/t5/Archicad-Python-API/Getting-quot-Show-On-Renovation-Filter-quot-parameter-in-Python/m-p/400342#M898</link>
    <description>&lt;P&gt;I have a few renovation filters set in my project meant to represent different 'Design options'. At the moment those options consist only of zones, as the following:&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="pedrocollares_1-1696181363856.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/46630iA55D0AC6C1ACB9B9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pedrocollares_1-1696181363856.png" alt="pedrocollares_1-1696181363856.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pedrocollares_2-1696181377632.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/46631iA030CF532797D8FC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pedrocollares_2-1696181377632.png" alt="pedrocollares_2-1696181377632.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm putting up some routines to extract zone information using Python. I'd like to extract those zone informations of each of those design options which I used the renovation filter to model. Is there a way to access the "Show On Renovation Filter" parameter of elements with Python? Is the only way to achieve that creating a custom property?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Thu, 26 Sep 2024 10:18:16 GMT</pubDate>
    <dc:creator>pedrocollares</dc:creator>
    <dc:date>2024-09-26T10:18:16Z</dc:date>
    <item>
      <title>Getting "Show On Renovation Filter" parameter in Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Getting-quot-Show-On-Renovation-Filter-quot-parameter-in-Python/m-p/400342#M898</link>
      <description>&lt;P&gt;I have a few renovation filters set in my project meant to represent different 'Design options'. At the moment those options consist only of zones, as the following:&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="pedrocollares_1-1696181363856.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/46630iA55D0AC6C1ACB9B9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pedrocollares_1-1696181363856.png" alt="pedrocollares_1-1696181363856.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pedrocollares_2-1696181377632.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/46631iA030CF532797D8FC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="pedrocollares_2-1696181377632.png" alt="pedrocollares_2-1696181377632.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm putting up some routines to extract zone information using Python. I'd like to extract those zone informations of each of those design options which I used the renovation filter to model. Is there a way to access the "Show On Renovation Filter" parameter of elements with Python? Is the only way to achieve that creating a custom property?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2024 10:18:16 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Getting-quot-Show-On-Renovation-Filter-quot-parameter-in-Python/m-p/400342#M898</guid>
      <dc:creator>pedrocollares</dc:creator>
      <dc:date>2024-09-26T10:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "Show On Renovation Filter" parameter in Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Getting-quot-Show-On-Renovation-Filter-quot-parameter-in-Python/m-p/400380#M899</link>
      <description>&lt;P&gt;Update: My answer is wrong sorry! See the answer from &lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/18596"&gt;@JT1986&lt;/a&gt; for the correct answer.&lt;BR /&gt;&lt;BR /&gt;&lt;STRIKE&gt;Hi Pedro!&lt;/STRIKE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRIKE&gt;Renovation filters are not available with the standard Python API. You can check what's available in the &lt;A href="https://archicadapi.graphisoft.com/JSONInterfaceDocumentation/#Introduction" target="_self"&gt;JSONInterfaceDocumentation&lt;/A&gt;.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;Unfortunately searching for "Renovation" doesn't turn up any command.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;I can think of two possible workarounds:&lt;/STRIKE&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;STRIKE&gt;Already mentioned by you: Create a custom expression property which basically duplicates the "Show On Renovation Filter" information.&lt;/STRIKE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRIKE&gt;Add a new command to the &lt;A href="https://github.com/tlorantfy/archicad-additional-json-commands" target="_self"&gt;Additional JSON Commands project&lt;/A&gt; (hard without previous C++ experience)&lt;/STRIKE&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;Hope that Helps!&lt;/STRIKE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 08:10:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Getting-quot-Show-On-Renovation-Filter-quot-parameter-in-Python/m-p/400380#M899</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2023-10-02T08:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "Show On Renovation Filter" parameter in Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Getting-quot-Show-On-Renovation-Filter-quot-parameter-in-Python/m-p/400395#M900</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Actually you can get the information of the renovation status with Python API without workarounds.&amp;nbsp;There is two built-in properties that allow you to get information about either the renovation status of the element or in which renovation filter element is shown.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Those properties are these two:&lt;/P&gt;&lt;P&gt;BuiltInPropertyUserId {'nonLocalizedName': 'Category_RenovationStatus', 'type': 'BuiltIn'}&lt;/P&gt;&lt;P&gt;BuiltInPropertyUserId {'nonLocalizedName': 'Category_ShowOnRenovationFilter', 'type': 'BuiltIn'}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wrote a little script that you can test. Hope it works for you.&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&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
act = conn.types
acu = conn.utilities

elements = acc.GetAllElements()
ElementID = acu.GetBuiltInPropertyId('General_ElementID')
ElementTypes = acu.GetBuiltInPropertyId('General_Type')
RenovationID = acu.GetBuiltInPropertyId('Category_RenovationStatus')
FilterID = acu.GetBuiltInPropertyId('Category_ShowOnRenovationFilter')
ElementValues1 = acc.GetPropertyValuesOfElements(elements, [RenovationID])
ElementValues2 = acc.GetPropertyValuesOfElements(elements, [FilterID])
ElementIDValues = acc.GetPropertyValuesOfElements(elements, [ElementID])
ElementTypeValues = acc.GetPropertyValuesOfElements(elements, [ElementTypes])

print("----Renovation status:----")
for value in range(len (elements)):
    Statusvalue=str(ElementValues1[value].propertyValues[0].propertyValue.value)
    IDvalue1 = str(ElementIDValues[value].propertyValues[0].propertyValue.value)
    Typevalue1 = str(ElementTypeValues[value].propertyValues[0].propertyValue.value)
    print("Element Type:",Typevalue1, "---",Statusvalue, "___ELEMENT ID:", IDvalue1)
print("")
print("---Show on renovation filter:----")
for value2 in range(len (elements)):
    Filtervalue=str(ElementValues2[value2].propertyValues[0].propertyValue.value)
    IDvalue2 = str(ElementIDValues[value2].propertyValues[0].propertyValue.value)
    Typevalue2 = str(ElementTypeValues[value2].propertyValues[0].propertyValue.value)
    print("Element Type:",Typevalue2, "---",Filtervalue,"___ELEMENT ID:", IDvalue2)&lt;/LI-CODE&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;Below you can see the result after running the script (Element type, Renovation and element ID).&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JT1986_1-1696232970848.png" style="width: 808px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/46642iB5287598D2C30B97/image-dimensions/808x195?v=v2" width="808" height="195" role="button" title="JT1986_1-1696232970848.png" alt="JT1986_1-1696232970848.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-JT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 08:03:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Getting-quot-Show-On-Renovation-Filter-quot-parameter-in-Python/m-p/400395#M900</guid>
      <dc:creator>JT1986</dc:creator>
      <dc:date>2023-10-02T08:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "Show On Renovation Filter" parameter in Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Getting-quot-Show-On-Renovation-Filter-quot-parameter-in-Python/m-p/400414#M902</link>
      <description>&lt;P&gt;Great! Thanks a bunch &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/8527"&gt;@BerndSchwarzenbacher&lt;/a&gt;&amp;nbsp;your first suggestion is exactly how I have it set up atm&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it's always best not to rely on custom properties in those routines. I'll follow the solution brang up by&amp;nbsp;&lt;a href="https://community.graphisoft.com/t5/user/viewprofilepage/user-id/18596"&gt;@JT1986&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 12:27:46 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Getting-quot-Show-On-Renovation-Filter-quot-parameter-in-Python/m-p/400414#M902</guid>
      <dc:creator>pedrocollares</dc:creator>
      <dc:date>2023-10-02T12:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "Show On Renovation Filter" parameter in Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Getting-quot-Show-On-Renovation-Filter-quot-parameter-in-Python/m-p/574012#M912</link>
      <description>&lt;P&gt;Bringing up this topic again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why&lt;SPAN&gt;&amp;nbsp;'Category_ShowOnRenovationFilter' returns something that looks like a dictionary, instead of simply a string containing the Renovation Filter's name?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'd like to use only the name string of the renovation filter, and in case it is "AllRelevantFilters", use that as a name as well. I tried using the "type" value as a key to return the value assigned to the first key of the dict, but with no success. Seems to me it isn't actually a dictionary.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2023 02:17:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Getting-quot-Show-On-Renovation-Filter-quot-parameter-in-Python/m-p/574012#M912</guid>
      <dc:creator>pedrocollares</dc:creator>
      <dc:date>2023-11-04T02:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: Getting "Show On Renovation Filter" parameter in Python</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Getting-quot-Show-On-Renovation-Filter-quot-parameter-in-Python/m-p/574027#M913</link>
      <description>&lt;P&gt;The response objects contain more information than just the values because properties can vary a lot. So the same query can lead to a lot of different results depending on the element and the property itself. The extra information is necessary to differentiate between all the different results.&lt;BR /&gt;&lt;BR /&gt;The objects themselves are not dictionaries. It's just that their string representation looks very similar to dictionaries. You can often convert them to dictionaries with &lt;EM&gt;.to_dict()&lt;/EM&gt;, but I wouldn't necessary recommend it. I think it's better to access the respective members of the objects.&lt;BR /&gt;&lt;BR /&gt;Here's an example how you could get the value depending on the type:&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
acu = conn.utilities

elements = acc.GetAllElements()

properties = [
    'General_ElementID',
    'General_Type',
    'Category_RenovationStatus',
    'Category_ShowOnRenovationFilter',
]
propertyGuids = [acu.GetBuiltInPropertyId(propName) for propName in properties]

propValsOfAllElems = acc.GetPropertyValuesOfElements(elements, propertyGuids)

for propValsOfOneElem in propValsOfAllElems:
    for propDef, propVal in zip(properties, propValsOfOneElem.propertyValues):
        value = ''
        if propVal.propertyValue.type == 'string':
            value = propVal.propertyValue.value
        elif propVal.propertyValue.type == 'singleEnum':
            value = propVal.propertyValue.value.nonLocalizedValue
        else:
            value = 'Evaluation for this property type not yet implemented!'

        print(propDef + ':', value)

    print()&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;BR /&gt;Feel free to ask any questions about the code in case something is unclear!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps,&lt;/P&gt;
&lt;P&gt;Bernd&lt;/P&gt;</description>
      <pubDate>Sat, 04 Nov 2023 09:14:09 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Getting-quot-Show-On-Renovation-Filter-quot-parameter-in-Python/m-p/574027#M913</guid>
      <dc:creator>BerndSchwarzenbacher</dc:creator>
      <dc:date>2023-11-04T09:14:09Z</dc:date>
    </item>
  </channel>
</rss>

