We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

Archicad Python API
About automating tasks in Archicad using the Python API.

Python Error Message

poco2013
Mentor
In Working with Python API, I am trying to change some properties using:error_msg = acc.SetPropertyValuesOfElements(elemPropertyValues)
With one element, WC 23, I am getting the error message of:

ERROR{'code':6001,'message':teamwork Permission Denied'}

As a test, I am using the Archicad Sample House plan 23 which I opened in 24.There appear to be three WC23 in the plan. one on the first floor and two on the ground floor. My return says there are 4 objects, however

Anyone know how to fix this?? I am not using teamwork.
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
1 REPLY 1
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
Hi Gerry,

Thank you for reporting us this issue!
This is certainly a bug in our API. Next time please report bugs at our Support Portal (https://graphisoft.atlassian.net/servicedesk/customer/portal/5) or in email (archicadapi@graphisoft.com), that way we can response faster.

I wrote a script which detects ElementID conflicts and tries to generate unique ElementID for conflicted elements. Using this script I was able to reproduce your issue with the Archicad Hillside House Sample Project (https://helpcenter.graphisoft.com/knowledgebase/103415/) without using Teamwork.
from archicad import ACConnection

conn = ACConnection.connect()
assert conn

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

elementIdPropertyId = acu.GetBuiltInPropertyId('General_ElementID')
elements = acc.GetAllElements()

newElemPropertyValues = []

idConflicts = {}
propertyValuesOfElements = acc.GetPropertyValuesOfElements(elements, [elementIdPropertyId])
for i in range(len(propertyValuesOfElements)):
	elementId = elements.elementId
	elementPropertyValues = propertyValuesOfElements
	for elementPropertyValue in elementPropertyValues.propertyValues:
		propertyValue = elementPropertyValue.propertyValue
		if propertyValue.value in idConflicts:
			idConflicts[propertyValue.value] += 1
			propertyValue.value += f' {idConflicts[propertyValue.value]}'
			newElemPropertyValues.append(act.ElementPropertyValue(elementId, elementIdPropertyId, propertyValue))
		else:
			idConflicts[propertyValue.value] = 1

result = acc.SetPropertyValuesOfElements(newElemPropertyValues)
print(result)
I added this to our bugfixing short-term backlog and I hope we can fix this issue soon.
Identifier: DEF-1317 (Python API: SetPropertyValuesOfElements returns "TeamWork permission denied" error with Solo project)