Showing results for 
Search instead for 
Did you mean: 
Showing results for 
Search instead for 
Did you mean: 
2024 Technology Preview Program

2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations

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

Python Add-On Command Handler Error

I am trying to create a application which inputs parameters from a Python dialog to configure and place a Library Part. When I call the Python application internal to Archicad the program "hangs" at the point of library part placement. When I then exit the Python dialog, the part is placed If i call the Python dialog externally via a IDE, visual Code, the part is placed normally without error. The error that I am getting for the internal python is below: This error is preventing Python from shutting down normally and thus the "hang".

The error is:

File "C:\Users\gteac\Documents\Keynotes\", line 799, in <lambda>
place_key = Button(root,text="Place KeyNote",command=lambda : archicad_element(buffer)) # Sets note in Archicad
File "C:\Users\gteac\Documents\Keynotes\", line 341, in archicad_element
response = acc.ExecuteAddOnCommand(act.AddOnCommandId('AdditionalJSONCommands','KeyNote'),parameters)
File "C:\Users\gteac\AppData\Local\Programs\Python\Python39\lib\site-packages\archicad\releases\ac25\", line 183, in ExecuteAddOnCommand
raise UnsucceededCommandCall(result)
archicad.releases.ac25.b2255commands.UnsucceededCommandCall: {'succeeded': False, 'error': {'code': 4001, 'message': 'Invalid program status (ongoing user input)'}}

I have no idea what err 4001 means or where to look? I made a demo video which shows the problem.

Any thoughts on what I need to look at further?

Windows 11 - Visual Studio 2022; ArchiCAD 27