License Delivery maintenance is expected to occur on Saturday, November 30, between 8 AM and 11 AM CET. This may cause a short 3-hours outage in which license-related tasks: license key upload, download, update, SSA validation, access to the license pool and Graphisoft ID authentication may not function properly. We apologize for any inconvenience.
Archicad C++ API
About Archicad add-on development using the C++ API.

Archicad API in .NET???

leceta
Expert
Just a question from a noob: Would it make sense an Archicad API in .NET?? would this make easier to develop connection plugins in other platforms like Grasshopper?

Would it make sense to wrap ArchiCAD C++ library to other languages?

Cheers
aitor
25 REPLIES 25
stefan
Advisor
Have you seen Paupertools? This is a plug-in that promises to open up the ARCHICAD SDK to Python.

https://github.com/iotong/PauperTools

Haven't been able to test and a bit unclear how it works and what it is currently capable of, but I find it interesting. I don't have the knowledge how wrapping the ARCHICAD C++ SDK into Python would work, but apparently, it seems feasible. I does seem to open up a whole world of possibilities for other CAD, 3D and BIM software... Vectorworks, Revit (Dynamo), Rhino, Maya, ...
--- stefan boeykens --- bim-expert-architect-engineer-musician ---
Archicad28/Revit2024/Rhino8/Solibri/Zoom
MBP2023:14"M2MAX/Sequoia+Win11
Archicad-user since 1998
my Archicad Book
Laszlo Nagy
Community Admin
Community Admin
Yes, the interesting thing is that Revit, Rhino, Vectorworks and Allplan all have Python support.
ARCHICAD is behind in this area.

Seems to me that although Python is more complex than GDL, it is very capable, yet much simpler than C++, so it offers a way for people to add functionality to their BIM application.
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac27
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
LaszloNagy wrote:
Yes, the interesting thing is that Revit, Rhino, Vectorworks and Allplan all have Python support.
ARCHICAD is behind in this area.

It's not a big secret that GRAPHISOFT is already working on an official Python API.

I'm curious about your opinion, for what would you use the Python API if it would be as powerful as the C++ API?
Laszlo Nagy
Community Admin
Community Admin
I am not a programmer myself, I am pretty good with GDL in general.
C++ for me is a much more complex of a programming environment to learn.
My understanding is that it is much easier to learn Python than C++.

I would probably use it to add functions to ARCHICAD that do not exist yet.
For example, there was a thread where someone asked if it is possible to find out how many groups there are in the project. That would probably be a simple case of writing a Python script to achieve that.

Or, another recent question was: how to find missing library part instances. I imagine one could write a simple Python script that could find and give info about these missing library part instances not only in Floor Plan Viewpoints, but in any Viewpoint.

Or, another one: create a Python script to give a list and info about all the SEOs in the Project.

Or, there could be a Python script that would highlight or change the Pen of all Dimension Texts that were modified from their measured value. There are just so many cases to mention.

In general I think an API should give access to the whole project database (all Viewpoints, Project Map, Layouts, Publisher Sets, etc.) and enable you to do anything you can do using your mouse and keyboard. It would open the door to automating a lot of tasks and creating a lot of functionality that is not available (mostly because of development priorities by GS).
Loving Archicad since 1995 - Find Archicad Tips at x.com/laszlonagy
AMD Ryzen9 5900X CPU, 64 GB RAM 3600 MHz, Nvidia GTX 1060 6GB, 500 GB NVMe SSD
2x28" (2560x1440), Windows 10 PRO ENG, Ac20-Ac27
poco2013
Mentor
Hopefully, Graphisoft won't forget to include a debugger or allow one like PyCharm to be attached?
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
leceta
Expert
Automate whatever is possible to automate.
Access to model data on big files, without the need to graphically display then.
Programatically manage attributes.
Programatically rename hundred of layouts, views, etc...
Create custom forms to feet on office idiosyncratic workflows.
Programatically manage Graphic Overrides.
programatically import dwg plans to layouts, properly naming the layouts.
Connect to SQL database to I\O data for whatever reason.
Connect to external applications using Rest Api to optimize workflows and interoperability.
Create GDL objects using python syntax (well, one can dream), OOP and hopefully with a +modern IDE with code autocompletion and syntax highlighting.
Empower GDL objects with external modules, in particular with 3d geometry processing libraries.
leceta
Expert
It's not a big secret that GRAPHISOFT is already working on an official Python API.
really, it wasn't??? c'mon...
Anonymous
Not applicable
Tibor wrote:

It's not a big secret that GRAPHISOFT is already working on an official Python API.


That's good to know. Are there any details of this development and timeline?

I was wondering recently is it so hard to make C# running in C++ code. All of the languages C#, C++ and Python are .Net languages so there are technically capable of working together. As far as I know, there are some techniques, for example, C++/CLI to do this kind of stuff.
Ralph Wessel
Mentor
kzaremba wrote:
I was wondering recently is it so hard to make C# running in C++ code. All of the languages C#, C++ and Python are .Net languages so there are technically capable of working together. As far as I know, there are some techniques, for example, C++/CLI to do this kind of stuff.
Only if you're working in a .NET environment. C++/CLI should really be thought of as a different language – it's a Microsoft spec that isn't compatible with C++. We've used it as a 'glue' to implement software originally written as standard C++ in .NET environments, but you can't do it the other way around. It's part of the standard MS 'embrace, extend, extinguish' approach to software.
Ralph Wessel BArch
Software Engineer Speckle Systems
dfintha
Graphisoft Alumni
Graphisoft Alumni
Hello,

As Ralph said, these are only true in a .NET environment. Otherwise, neither Python nor C++ are .NET languages, although .NET implementations of them exist (C++/CLI and IronPython). ARCHICAD is not built in a .NET environment, as it would highly impact its performance, which would be a great cost.
Since Python is implemented in C, it isn't difficult to use and extend it in C/C++ programs. Their documentation* even has a whole section about such process.

Best regards,
Dénes

P.S.: I'm eager to hear more about what users would like to do in a Python API, I've already wrote down what I could find in this forum so far.

* https://docs.python.org/3.6/extending/extending.html