<?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 'TeamWork permission denied' in Archicad Python API</title>
    <link>https://community.graphisoft.com/t5/Archicad-Python-API/Python-TeamWork-permission-denied/m-p/335641#M184</link>
    <description>&lt;P&gt;Hey Gerry,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for your help (again &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;I was today in the office and could try out the code you posted and it worked!&lt;/P&gt;&lt;P&gt;Well, not in every case since i still get for some elements the error msg, but when i check the project every object so far got it classification set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think this has something to do with hotlinks elements we use, wouldnt be the first time they cause trouble. But for now it seems like i can do what i need to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help and Kind Regards&lt;/P&gt;&lt;P&gt;Ziyad&lt;/P&gt;</description>
    <pubDate>Thu, 14 Apr 2022 15:56:35 GMT</pubDate>
    <dc:creator>Dayiz</dc:creator>
    <dc:date>2022-04-14T15:56:35Z</dc:date>
    <item>
      <title>Python 'TeamWork permission denied'</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Python-TeamWork-permission-denied/m-p/335051#M181</link>
      <description>&lt;P&gt;Hello dear Graphisoft community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on automation with Python and i wanted to write a script which replaces old classifiers with new ones. So i wrote this small script:&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;DIV&gt;&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&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;utilities&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;nopId&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;''&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;elem_list&lt;/SPAN&gt;&lt;SPAN&gt; = []&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;systems&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;acc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;GetAllClassificationSystems&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;for&lt;/SPAN&gt; &lt;SPAN&gt;s&lt;/SPAN&gt; &lt;SPAN&gt;in&lt;/SPAN&gt; &lt;SPAN&gt;systems&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;s&lt;/SPAN&gt;&lt;SPAN&gt;.name == 'NOP Klassifizierung'&lt;/SPAN&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;nopId&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;s&lt;/SPAN&gt;&lt;SPAN&gt;.classificationSystemId &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;all_elem&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;acc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;GetAllElements&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;for&lt;/SPAN&gt; &lt;SPAN&gt;elem&lt;/SPAN&gt; &lt;SPAN&gt;in&lt;/SPAN&gt; &lt;SPAN&gt;all_elem&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ec&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;act&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ElementClassification&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;elem&lt;/SPAN&gt;&lt;SPAN&gt;.elementId, &lt;/SPAN&gt;&lt;SPAN&gt;act&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;ClassificationId&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;nopId&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;elem_list&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;append&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;ec&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;acc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;SetClassificationsOfElements&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;elem_list&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;But when i execute the script I get for 90% of the elements the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"FailedExecutionResult {'success': False, 'error': {'code': 6001, 'message': 'TeamWork permission denied'}}"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't seem to find the meaning of this error message and the only other reference i find is a 2 year old post from here (&amp;nbsp;&lt;A href="https://community.Graphisoft.com/t5/Developer-forum/Python-Error-Message/m-p/263656#M5765" target="_blank" rel="noopener"&gt;https://community.Graphisoft.com/t5/Developer-forum/Python-Error-Message/m-p/263656#M5765&lt;/A&gt;&amp;nbsp;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So what does this error msg mean? What can i do to prevent it? And since this error was perceived a bug I'm wondering if it got resolved now and it's working as intended or if it is still bugged.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, how does &lt;SPAN&gt;acc&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;SetClassificationsOfElements&lt;/SPAN&gt;&lt;SPAN&gt;() work exactly? I tried to change the Classificationsystem of a single Element with this function and i got "SuccessfulExecutionResult {'success': True}" as result in my terminal, but in Archicad the classificationsystem remains unchanged. Am I misunderstanding the purpose of this function?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help and Kind Regards&lt;/P&gt;&lt;P&gt;Ziyad&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 13:15:29 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Python-TeamWork-permission-denied/m-p/335051#M181</guid>
      <dc:creator>Dayiz</dc:creator>
      <dc:date>2022-04-08T13:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Python 'TeamWork permission denied'</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Python-TeamWork-permission-denied/m-p/335088#M182</link>
      <description>&lt;P&gt;AFAIK -- Type ElementClassification&amp;nbsp; uses the element classification ID (sub level) not the system classification (top level). To find the ID of a sub level class use:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;classId = acu.FindClassificationItemInSystem("top level name", "sub level name")&lt;/P&gt;</description>
      <pubDate>Fri, 08 Apr 2022 17:26:01 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Python-TeamWork-permission-denied/m-p/335088#M182</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2022-04-08T17:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Python 'TeamWork permission denied'</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Python-TeamWork-permission-denied/m-p/335273#M183</link>
      <description>&lt;P&gt;Attached is sample script which corrects the error and demos changing all object classes to "morph"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from Archicad import ACConnection
import sys
conn = ACConnection.connect()
assert conn

acc = conn.commands
act = conn.types
acu = conn.utilities

nopId = ''
elem_list = []
 
systems = acc.GetAllClassificationSystems()
for s in systems:
    if(s.name == 'Archicad Classification'):
        nopId = s.classificationSystemId  
all_elem = acc.GetAllElements()
classId = acu.FindClassificationItemInSystem("Archicad Classification",
 "Morph")
classId = classId.classificationItemId

for elem in all_elem:
    
    itemId = act.ClassificationId(nopId,classId)
    ec = act.ElementClassification(elem.elementId, itemId)
    elem_list.append(ec)

acc.SetClassificationsOfElements(elem_list) &lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 11 Apr 2022 20:22:38 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Python-TeamWork-permission-denied/m-p/335273#M183</guid>
      <dc:creator>poco2013</dc:creator>
      <dc:date>2022-04-11T20:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: Python 'TeamWork permission denied'</title>
      <link>https://community.graphisoft.com/t5/Archicad-Python-API/Python-TeamWork-permission-denied/m-p/335641#M184</link>
      <description>&lt;P&gt;Hey Gerry,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for your help (again &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;I was today in the office and could try out the code you posted and it worked!&lt;/P&gt;&lt;P&gt;Well, not in every case since i still get for some elements the error msg, but when i check the project every object so far got it classification set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think this has something to do with hotlinks elements we use, wouldnt be the first time they cause trouble. But for now it seems like i can do what i need to do.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help and Kind Regards&lt;/P&gt;&lt;P&gt;Ziyad&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 15:56:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-Python-API/Python-TeamWork-permission-denied/m-p/335641#M184</guid>
      <dc:creator>Dayiz</dc:creator>
      <dc:date>2022-04-14T15:56:35Z</dc:date>
    </item>
  </channel>
</rss>

