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

Lua API

Anonymous
Not applicable
What are the chances of a wild lua api emerging besides of the default, python one? If zero, what'd it take to not be zero?
7 REPLIES 7
Karl Ottenstein
Moderator
Given the major resources to add Lua... I'd say you would need to make a case with multiple examples of what Lua would provide to ARCHICAD users that Python does not - especially considering that the audience for even Python within ARCHICAD is quite limited.
One of the forum moderators
AC 28 USA and earlier   •   macOS Sequoia 15.2, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB
runxel
Legend
This thing will probably never exist.
Even the official Python API is more or less an example, since that "API" is barely anything more than a wrapper around the JSON API.
Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
poco2013
Mentor
runxel wrote:
Even the official Python API is more or less an example, since that "API" is barely anything more than a wrapper around the JSON API.
Possibly, you may have that reversed. JSON is used to wrap the Python commands in a database format (json) so that any language that supports json can send commands (inquiries) to Archicad.

The Archicad Python API extensively uses Python classes and the Python language to communicate. Since Python script can and does communicate directly with Archicad, I see no usage for the json wrapper unless one is already using another language and wants to embed a json data script.

I have been using Python directly since its first release in 24 and in the Betas before and it is a extremely stable interface. I doubt if Luna would ever be used, since it does not support classes which are simulated in it by just being being added to functions. At this point, that would require a complete rewrite of a already stable API with no practical advantage , plus Luna severely limits the Python language. Luna's real usage is intended for small applications where memory and speed are a concern which is not the case here.Keep in mind that one of the key advantages of Python is the availability of external modules which greatly simplify versatility -- already demonstrated.

The real problem with Python is that its initial implementation is so limited that there are very few practical applications to demonstrate. Of course, there is little interest since there is nothing of interest at present --- "Chicken or the Egg". Those of us who endorse this new API, can not demo meaningful applications, since, with any attempt, will run into serious roadblocks of non-supported functions.

I expect ,that by mid year with the release of 25, we'll see if Graphisoft intends to support this new API or it is just more marketing "hype". As of now, I see no practical usage for Python, Json, Luna, or whatever. Something needs to change and be demonstrated before serious user interest will occur? At the present time, there isn't even a medium to convey constructive concerns to Graphisoft. That should say something about Graphisoft's support for the new Python API.
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
runxel
Legend
poco2013 wrote:
Possibly, you may have that reversed. JSON is used to wrap the Python commands in a database format (json) so that any language that supports json can send commands (inquiries) to Archicad.
No, Gerry. Seems more like you got that reversed somehow.

To quote the Python package docs:
> This is the official Python binding for the ARCHICAD JSON command interface.

There once was a real Python interface (if you took part in the betas for that you'll remember), but GS sacked that since it possibly seemed to be difficult to maintain. However that one was really powerful and you could do things which aren't doable with the new JSON interface.

As quoted above the Python package only provides a wrapper. In the background there is only communication over an locally exposed HTTP port to Archicad. Archicad will return JSON data to any well-formed request.

A last quote from the JSON interface docs:
> The ARCHICAD JSON API provides a way for external applications to automate ARCHICAD functions. It is a one-way communication from the external software to ARCHICAD. The communication happens via HTTP using JSON messages.
> Because JSON is a language-independent data format, you can use any programming language to send commands to ARCHICAD.
Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
poco2013
Mentor
Potato -- Potato

I have written several Python interfaces/applications with Archicad and never used JSON and don't intend too. Python can be used by itself, either internally or externally, and I have demoed both without JSON The classes and commands are completely Python and run in the Python embedded environment.They simply request data from Archicad.. JSON is a Data format not a Programming language

"JavaScript Object Notation (JSON) is a standard text-based format for representing structured data based on JavaScript object syntax. It is commonly used for transmitting data in web applications (e.g., sending some data from the server to the client, so it can be displayed on a web page, or vice versa)."

After the Beta in 23 Graphisoft removed almost all of the "create" capabilities in order to concentrate on the new Class style format. I can't argue with that but its my belief that it fatally crippled usage unless it is restored.
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
runxel
Legend
poco2013 wrote:
I have written several Python interfaces/applications with Archicad and never used JSON and don't intend too. Python can be used by itself, either internally or externally, and I have demoed both without JSON The classes and commands are completely Python and run in the Python embedded environment.They simply request data from Archicad. JSON is a Data format not a Programming language.
I don't want to argue with you, but I still have to point out, that there seems to be a misunderstanding here.
It's true, JSON is not a programming language (nobody in this thread has said this to be so in the first place, tho).

You write "They simply request data from Archicad" – and how is this done?
By getting JSON data out of Archicad. Which means you have used JSON in any case. There is simply no other way. 😉

Cheers!
Lucas Becker | AC 27 on Mac | Graphisoft Insider Panelist | Author of Runxel's Archicad Wiki | Editor at SelfGDL | Developer of the GDL plugin for Sublime Text | My List of AC shortcomings & bugs | I Will Piledrive You If You Mention AI Again |

POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»
leceta
Expert
Agree with Runxel, JSON API opens accessibility to any language. Python API is just a convenient integration of the JSON API into the Archicad environment. As I see it.