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

Python add-on for archicad

noriksaroyan
Booster

Hi everyone! 

So I have this one-file python script which connects to opened archicad 26 project, gets info about certain elements and writes it into a json file.

The question is, how can "convert" this python script into a archicad add-on? Should I put it in add-ons folder? If yes, to which file type should I convert this?

The idea of the whole thing is that i want to use the same add-on from any project on my device, so it will run the script with a press of a button in archicad.

Thanks in advance!

3 ACCEPTED SOLUTIONS

Accepted Solutions
Solution
poco2013
Mentor

A Python script is NOT a AddOn. Nor can it be converted to a AddOn. A C++ AddOn is a complied DLL with the extension "apx" There is no way to run a Python script from a button in Archicad. That feature is not offered (YET). In Archicad, You must run a Python script from the Python Palette.

 

You can run a script external to Archicad (assuming Archicad is running) by using a IDE or a bat file shortcut or , as i use, a pushbutton in a StreamDeck device which is configured to a bat file or directly to Python..

Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27

View solution in original post

Solution

It is not possible to use .NET in Archicad. .NET is mostly for  the Window OS usage although Microsoft contents otherwise. AFASIK, there have been some requests to add it to the API, as Graphisoft said they are now exploring other languages. --- As in more user common. Just what we need --- six languages in Archicad. My guess (ONLY) is that if they did incorporate .NET, it would run on top on the C++ API as  a alternative to Python, I don't see any advantage.

Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27

View solution in original post

Solution
MudratDetector
Enthusiast

C++.

Different versions of ArchiCAD require different versions of Visual Studio.


Also required:

- - getting a Graphisoft developer ID.

- - downloading the ArchiCAD version specific API

- - more info found here:  https://archicadapi.graphisoft.com/

 

- Chris

Chris Gilmer
Intel i9-12950HX CPU @ 2.30GHz, 16 cores
NVIDIA GeForce RTX 3080
48.0 GB RAM
Windows 10 Pro 64-bit

View solution in original post

7 REPLIES 7
Solution
poco2013
Mentor

A Python script is NOT a AddOn. Nor can it be converted to a AddOn. A C++ AddOn is a complied DLL with the extension "apx" There is no way to run a Python script from a button in Archicad. That feature is not offered (YET). In Archicad, You must run a Python script from the Python Palette.

 

You can run a script external to Archicad (assuming Archicad is running) by using a IDE or a bat file shortcut or , as i use, a pushbutton in a StreamDeck device which is configured to a bat file or directly to Python..

Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27

Thank you for your response! And while you're here, is it possible to do this on any .NET running language or only c++ and will this feature be added for python in near future? 

Solution

It is not possible to use .NET in Archicad. .NET is mostly for  the Window OS usage although Microsoft contents otherwise. AFASIK, there have been some requests to add it to the API, as Graphisoft said they are now exploring other languages. --- As in more user common. Just what we need --- six languages in Archicad. My guess (ONLY) is that if they did incorporate .NET, it would run on top on the C++ API as  a alternative to Python, I don't see any advantage.

Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27

 And another question, in which languages I can create add-ons? 

 

Solution
MudratDetector
Enthusiast

C++.

Different versions of ArchiCAD require different versions of Visual Studio.


Also required:

- - getting a Graphisoft developer ID.

- - downloading the ArchiCAD version specific API

- - more info found here:  https://archicadapi.graphisoft.com/

 

- Chris

Chris Gilmer
Intel i9-12950HX CPU @ 2.30GHz, 16 cores
NVIDIA GeForce RTX 3080
48.0 GB RAM
Windows 10 Pro 64-bit

Hi MudratDetector,

Do you know how much time it takes to get Graphisoft developer ID?
I sent an email 10 days ago but till now still no reply email.

 

Thank you, and I really hope to receive your response soon.

 

MudratDetector
Enthusiast

Seems like it only took a few days, maybe a week.  I received my 'offifial credentials' five or so years ago and do not recall exactly.  Have you checked your Spam folder for the reply?  10 days seems like a long time.

 

- chris

Chris Gilmer
Intel i9-12950HX CPU @ 2.30GHz, 16 cores
NVIDIA GeForce RTX 3080
48.0 GB RAM
Windows 10 Pro 64-bit