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.

API tutorials?

Mats_Knutsson
Advisor
Hi,
I'm looking for a tutorial how to make a simple palette with buttons in Archicad and connect python scripts to those buttons.
/Mats
AC 25 SWE Full

HP Zbook Fury 15,6 G8. 32 GB RAM. Nvidia RTX A3000.
3 REPLIES 3
poco2013
Mentor
The only example of embedding a python script in a C++ API Add-On is in the communication Manager example under Do_ExecutePythonScript. It uses the old 23 version of Python Script which is no longer used in 24. Also the upgrade of 22 & 23 no longer accepts the old version of the Python Add-On PythonSnippets.apx. Soooo no longer works, at least for me.

You can use Tkinter as a external dialog with buttons to execute Python scripts -- works fine but the interface is more crude appearing than native Archicad pallets.

At this point, i doubt if anyone other than Graphisoft knows (and their not talking) if there will be any advances in embedded Python in 25?
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
Mats_Knutsson
Advisor
poco2013 wrote:
The only example of embedding a python script in a C++ API Add-On is in the communication Manager example under Do_ExecutePythonScript. It uses the old 23 version of Python Script which is no longer used in 24. Also the upgrade of 22 & 23 no longer accepts the old version of the Python Add-On PythonSnippets.apx. Soooo no longer works, at least for me.

You can use Tkinter as a external dialog with buttons to execute Python scripts -- works fine but the interface is more crude appearing than native Archicad pallets.

At this point, i doubt if anyone other than Graphisoft knows (and their not talking) if there will be any advances in embedded Python in 25?
We've used Tkinter for some tests. We have put lots of effort in the Python development in-house but now we wait for deeper integration with Archicad. Meanwhile I want to be prepared from a user point of view which is the reason I asked for this. I basically want a palette where we can arrange our clever scripts in a regular Archicad environment that everyone recognizes.
AC 25 SWE Full

HP Zbook Fury 15,6 G8. 32 GB RAM. Nvidia RTX A3000.
poco2013
Mentor
I expect, that, you are already aware of this, but I'll mention it for those interested.If you want a more professional interface , you might check out "PyQt5". PyQt5 did not work with the 23 version but works fine with archicad 24. It is more versatile and professional but also still, does not have the minimalist appearance of the archicad dialogs.

It is free for testing and for individual use, but does require a license for commercial use.

Back to Archicad, I doubt strongly that Graphisoft will ever open up their GUI to Python, and embedding hundreds/thousand lines of python code in a add-on isn't practical.This creates a quandary and it is unfortunate that Graphisoft chooses not to dialog on constructive suggestions, unlike the 23 Beta?
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27