Lua API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2021-02-06
01:00 AM
- last edited on
2021-09-14
09:57 AM
by
Noemi Balogh
- Labels:
-
Automation (Python or JSON)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2021-02-06 02:30 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2021-02-06 07:54 PM
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.
POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2021-02-07 03:51 AM
runxel 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.
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.
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.
Windows 11 - Visual Studio 2022; ArchiCAD 27

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2021-02-07 01:42 PM
poco2013 wrote:No, Gerry. Seems more like you got that reversed somehow.
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.
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.
POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2021-02-07 06:14 PM
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.
Windows 11 - Visual Studio 2022; ArchiCAD 27

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2021-02-07 08:48 PM
poco2013 wrote:I don't want to argue with you, but I still have to point out, that there seems to be a misunderstanding here.
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.
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!
POSIWID – The Purpose Of a System Is What It Does /// «Furthermore, I consider that Carth... yearly releases must be destroyed»

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2021-02-08 11:11 AM