<?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: Python Question for Graphisoft in Archicad Python API</title>
    <link>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262842#M624</link>
    <description>Hi Gerry,&lt;BR /&gt;
&lt;BR /&gt;
Thank you for starting this topic! I hope there will be many questions here.&lt;BR /&gt;
But I think it's clearer if you start a new topic for each question or issue related to Python API.&lt;BR /&gt;
&lt;BR /&gt;
Some kind of intellisence is already available, just like code completion.&lt;BR /&gt;
I've just recorded a video in Visual Studio Code how it works:&lt;BR /&gt;
&lt;A href="https://ttprivatenew.s3.amazonaws.com/pulse/tlorantfy-graphisoft/attachments/14146027/python_script_writing_example.mp4" target="_blank"&gt;&lt;LINK_TEXT text="https://ttprivatenew.s3.amazonaws.com/p ... xample.mp4"&gt;https://ttprivatenew.s3.amazonaws.com/pulse/tlorantfy-graphisoft/attachments/14146027/python_script_writing_example.mp4&lt;/LINK_TEXT&gt;&lt;/A&gt;&lt;BR /&gt;
What do you think which intellisense features are missing the most?&lt;BR /&gt;
&lt;BR /&gt;
Yes, our main purpose is to allow simple automation for BIM Managers. So I would love to hear how are you doing the Python API!&lt;BR /&gt;
As you may have heard at the Building Together Event, we will extend the available JSON/Python commands in ARCHICAD 24 updates also and we will try to improve it continuously.</description>
    <pubDate>Mon, 20 Jul 2020 07:45:03 GMT</pubDate>
    <dc:creator>Tibor Lorantfy</dc:creator>
    <dc:date>2020-07-20T07:45:03Z</dc:date>
    <item>
      <title>Python Question for Graphisoft</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262841#M623</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;I have been working with the new Python API and like it a lot-- It has great potential for automation.&lt;BR /&gt;However, the most notable deficiency in the development environment is the lack of 'intellisence' in Pycharm.&lt;BR /&gt;&lt;BR /&gt;Wondering if 'intellisence' could be added or if that is even possible. It seems that if Python's purpose is to allow automation for the average project manager, that 'intellisence would be mandatory?&lt;/DIV&gt;</description>
      <pubDate>Wed, 15 Sep 2021 08:34:17 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262841#M623</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2021-09-15T08:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: Python Question for Graphisoft</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262842#M624</link>
      <description>Hi Gerry,&lt;BR /&gt;
&lt;BR /&gt;
Thank you for starting this topic! I hope there will be many questions here.&lt;BR /&gt;
But I think it's clearer if you start a new topic for each question or issue related to Python API.&lt;BR /&gt;
&lt;BR /&gt;
Some kind of intellisence is already available, just like code completion.&lt;BR /&gt;
I've just recorded a video in Visual Studio Code how it works:&lt;BR /&gt;
&lt;A href="https://ttprivatenew.s3.amazonaws.com/pulse/tlorantfy-graphisoft/attachments/14146027/python_script_writing_example.mp4" target="_blank"&gt;&lt;LINK_TEXT text="https://ttprivatenew.s3.amazonaws.com/p ... xample.mp4"&gt;https://ttprivatenew.s3.amazonaws.com/pulse/tlorantfy-graphisoft/attachments/14146027/python_script_writing_example.mp4&lt;/LINK_TEXT&gt;&lt;/A&gt;&lt;BR /&gt;
What do you think which intellisense features are missing the most?&lt;BR /&gt;
&lt;BR /&gt;
Yes, our main purpose is to allow simple automation for BIM Managers. So I would love to hear how are you doing the Python API!&lt;BR /&gt;
As you may have heard at the Building Together Event, we will extend the available JSON/Python commands in ARCHICAD 24 updates also and we will try to improve it continuously.</description>
      <pubDate>Mon, 20 Jul 2020 07:45:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262842#M624</guid>
      <dc:creator>Tibor Lorantfy</dc:creator>
      <dc:date>2020-07-20T07:45:03Z</dc:date>
    </item>
    <item>
      <title>Re: Python Question for Graphisoft</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262843#M625</link>
      <description>Thanks for your response Tibor:&lt;BR /&gt;
&lt;BR /&gt;
I installed VS code and the Intellisence is working there. Not sure why it's not working in PyCharm but it doesn't matter since it looks like I'll be switching to VS code.&lt;BR /&gt;
&lt;BR /&gt;
Looking forward to the next Python API update.</description>
      <pubDate>Mon, 20 Jul 2020 11:09:16 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262843#M625</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2020-07-20T11:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: Python Question for Graphisoft</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262844#M626</link>
      <description>Can confirm. It is indeed not working in PyCharm. Do I have to switch as well or do you know why it is not supported there?</description>
      <pubDate>Mon, 20 Jul 2020 12:16:48 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262844#M626</guid>
      <dc:creator>JSN</dc:creator>
      <dc:date>2020-07-20T12:16:48Z</dc:date>
    </item>
    <item>
      <title>Re: Python Question for Graphisoft</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262845#M627</link>
      <description>&lt;BLOCKQUOTE&gt;JSN wrote:&lt;BR /&gt;
Can confirm. It is indeed not working in PyCharm. Do I have to switch as well or do you know why it is not supported there?
&lt;/BLOCKQUOTE&gt;
I played with Pycharm a little more and did verify that it IS working somewhat. But not nearly as well as in VS code, as it is somewhat spotty. The main classes of acc,act,&amp;amp; acu seem to work OK but not so much others.&lt;BR /&gt;
&lt;BR /&gt;
There are two add-ins for Pycharm which have a better reputation. JEDI and KITE. KITE seems to be the better one. Other than that,I don't have any experience with them.&lt;BR /&gt;
&lt;BR /&gt;
I will be moving to VS code , now that I am aware of it. -- Free</description>
      <pubDate>Mon, 20 Jul 2020 16:18:54 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262845#M627</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2020-07-20T16:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: Python Question for Graphisoft</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262846#M628</link>
      <description>&lt;BLOCKQUOTE&gt;poco2013 wrote:&lt;BR /&gt;
I played with Pycharm a little more and did verify that it IS working somewhat. But not nearly as well as in VS code, as it is somewhat spotty. The main classes of acc,act,&amp;amp; acu seem to work OK but not so much others.&lt;BR /&gt;
&lt;BR /&gt;
There are two add-ins for Pycharm which have a better reputation. JEDI and KITE. KITE seems to be the better one. Other than that,I don't have any experience with them.&lt;BR /&gt;
&lt;BR /&gt;
I will be moving to VS code , now that I am aware of it. -- Free
&lt;/BLOCKQUOTE&gt;

Ok, thx for the hint. However I guess I have to convince IT for a switch to VS Code installation as well, as otherwise, for me personally, it's a bit hard to familiarize with the syntax as I could only guess or try to look it up.</description>
      <pubDate>Tue, 21 Jul 2020 08:38:08 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262846#M628</guid>
      <dc:creator>JSN</dc:creator>
      <dc:date>2020-07-21T08:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Python Question for Graphisoft</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262847#M629</link>
      <description>&lt;BLOCKQUOTE&gt;Tibor wrote:&lt;BR /&gt;
I've just recorded a video in Visual Studio Code how it works:&lt;BR /&gt;
&lt;A href="https://ttprivatenew.s3.amazonaws.com/pulse/tlorantfy-graphisoft/attachments/14146027/python_script_writing_example.mp4" target="_blank"&gt;&lt;LINK_TEXT text="https://ttprivatenew.s3.amazonaws.com/p ... xample.mp4"&gt;https://ttprivatenew.s3.amazonaws.com/pulse/tlorantfy-graphisoft/attachments/14146027/python_script_writing_example.mp4&lt;/LINK_TEXT&gt;&lt;/A&gt;
&lt;/BLOCKQUOTE&gt;
Hi Tibor,&lt;BR /&gt;
I tried running this code at my end, but I get this error: 
&lt;PRE&gt;Exception has occurred: TypeError
elements cannot be initialized with &amp;lt;class 'method'&amp;gt;
    for propertyValuesOfElement in acc.GetPropertyValuesOfElements(elements, properties):&lt;/PRE&gt;
Can you help understand what could be the reason?&lt;BR /&gt;
Thanks.</description>
      <pubDate>Tue, 21 Jul 2020 13:00:41 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262847#M629</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2020-07-21T13:00:41Z</dc:date>
    </item>
    <item>
      <title>Re: Python Question for Graphisoft</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262848#M630</link>
      <description>Seems like you maybe have misstyped, can only guess without seeing your actual code but, try this one with simplified variables&lt;BR /&gt;

&lt;PRE&gt;properties =[
    acu.GetBuiltInPropertyId("General_ElementID")
]

for e in acc.GetPropertyValuesOfElements(elements,properties):
    for pv in e.propertyValues:
        print(pv.propertyValue.value)&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jul 2020 13:24:16 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262848#M630</guid>
      <dc:creator>JSN</dc:creator>
      <dc:date>2020-07-21T13:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Python Question for Graphisoft</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262849#M631</link>
      <description>Thanks for your reply.&lt;BR /&gt;
&lt;BR /&gt;
UPDATE: Yes, there was a typo-error in acc.GetAllElements&lt;BR /&gt;
Full code:
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;from archicad import ACConnection

conn = ACConnection.connect()
assert conn

acc = conn.commands
act = conn.types
acu = conn.utilities

# typo-error in line below, GetAllElements() method:
elements = acc.GetAllElements 

properties = [
    acu.GetBuiltInPropertyId("General_ElementID")
]


print("\n")

for e in acc.GetPropertyValuesOfElements(elements,properties):
    for pv in e.propertyValues:
        print(pv.propertyValue.value)
&lt;/PRE&gt;

Thanks JSN for pointing it out.</description>
      <pubDate>Tue, 21 Jul 2020 13:45:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262849#M631</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2020-07-21T13:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Python Question for Graphisoft</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262850#M632</link>
      <description>I guess you forgot the parentheses when assigning the class to elements.&lt;BR /&gt;
&lt;BR /&gt;
It should be
&lt;PRE&gt;elements = acc.GetAllElements()&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jul 2020 14:06:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262850#M632</guid>
      <dc:creator>JSN</dc:creator>
      <dc:date>2020-07-21T14:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Python Question for Graphisoft</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262851#M633</link>
      <description>yes, that was it, thanks JSN!</description>
      <pubDate>Tue, 21 Jul 2020 14:35:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Python-Question-for-Graphisoft/m-p/262851#M633</guid>
      <dc:creator>dushyant</dc:creator>
      <dc:date>2020-07-21T14:35:02Z</dc:date>
    </item>
  </channel>
</rss>

