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

When can I use the graphisoft python plugin?

leilei
Enthusiast
Hello,
Does anyone know this question? I want to know when I can use graphisoft python plugin.Probably which version can use it? AC23 or AC24...
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
Thank you for your patience!
Please read the new announcement: https://archicad-talk.graphisoft.com/viewtopic.php?f=23&t=63336

View solution in original post

30 REPLIES 30
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
Hi,

Python Add-On development is still in the experimental phase, we are investigating the possible solutions.
One of those is to create a Python wrapper for the existing C++ API. We have an early implementation of that, but that may change. We'll make our choice depending on the real user requirements. So I cannot answer your question yet, but we are open to use cases, feel free to share your thoughts.
leilei
Enthusiast
Hi Tibor,

I found that allplan's SmartPart operation is very similar to AC's GDL.So whether the operation of the AC python plugin will be like the allplan python plugin.
poco2013
Mentor
My Comments:

A Python Wrapper would certainly be the quickest and most direct approach but there are other issues to consider if this immense effort is to be useful.
My concern is the present diversion of data access in Archicad. IFC, Properties, Expressions, GDL, & API data structures all have a slice and none have total access to all data. This severely limits practical user applications and creates confusion.
Also, some consideration should be made for small, quick macros, which don't require much planning or expertise necessary to accomplish those quick data display issues.

Finally, I hope Archicad does not 'reinvent the wheel' as they just did with expressions, by introducing another language format. Hopefully, Graphisoft will take a look at their sister corp, which has managed to simplify (somewhat) the marriage of both the configuration and display of data through their python/worksheet system. Not saying that even that can't be improved on. This is certainly not something that should be rushed into and should certainly first be reviewed by a skilled, diverse user base.
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
Ralph Wessel
Mentor
poco2013 wrote:
My concern is the present diversion of data access in Archicad. IFC, Properties, Expressions, GDL, & API data structures all have a slice and none have total access to all data.
The API has access to all of the above. Therefore, a Python wrapper potentially could too. But as Tibor says, it depends on what would provide the most benefit. Posting potential use-cases for Python scripts would be informative.
Ralph Wessel BArch
Software Engineer Speckle Systems
poco2013
Mentor
By way of example:
Frequently a quick means of performing area analysis is required. Typically done external to Archicad using Excel, etc. By area analysis, I mean -- FARs, setbacks, permeable, impermeable, overhangs, undisturbed areas and the percent & overall of each- All in a tabulated SS. -- You get the idea. In some software, this is only a half dozen lines of code in either Python or Ruby. i.e. a macro. Generally, this requires summing selected zones and subtracting others. Certainly this can be done now with the Archicad API -- But a PETA & difficult when you need to change the formulas.

The key is a means of doing a 'quick' search, sort, selection & enumeration based on some criteria.
Also, important is the use of regular expressions to simplify discovery - RegEX. Python has this feature as a add-on -- Hopefully, it will be included?
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
Akos Somorjai
Graphisoft
Graphisoft
poco2013 wrote:
By way of example:
Frequently a quick means of performing area analysis is required. Typically done external to Archicad using Excel, etc. By area analysis, I mean -- FARs, setbacks, permeable, impermeable, overhangs, undisturbed areas and the percent & overall of each- All in a tabulated SS. -- You get the idea. In some software, this is only a half dozen lines of code in either Python or Ruby. i.e. a macro. Generally, this requires summing selected zones and subtracting others. Certainly this can be done now with the Archicad API -- But a PETA & difficult when you need to change the formulas.

The key is a means of doing a 'quick' search, sort, selection & enumeration based on some criteria.
Also, important is the use of regular expressions to simplify discovery - RegEX. Python has this feature as a add-on -- Hopefully, it will be included?
Hi,

First, regex -- most external libraries can be used in the Python code.

Could you please post a sample Python script that achieves what you need in another software? I'm curious how much of that is available in our Python interface at the moment.

Best, Akos
poco2013
Mentor
Ahhhh –

I was not exactly clear in my “proposed example” What I was suggesting was a python function to return a array, dictionary or tuple to objects meeting a criteria. We can argue about the criteria but basically the standard such as ID, properties/parameters/attributes, layers etc..As of now in VW, a single parameter is returned to a single object or a sum of objects. In Chief Architect, parameters must be collected in labels and stored in Global memory before use. None of this is a major problem but is less intuitive. Easier to first obtain a array of GUID's then interrogate each or the array of GUID via a single function and/or a enumeration and then obtain back the parameters/properties/expression results of interest.

After data is collected, basically areas but sometimes conditionals/status, the calculations and display is routine and depends on the programs capabilities. Without a means of data display in layout, all of the above is fruitless. I particularly like VW's User Spreadsheets but even there could be more versatile.
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
Anonymous
Not applicable
I have to share same concerns as Gerry about this topic as well. Let me give a quick example of problem I had past week. I created a simple parameter for a wall which would read "override surface" information and based on that assign some predefined value. This is quite a simple programing task, as it would require one FOR loop and possible one IF statement nested inside the FOR loop. However, we currently do not have this capacity inside expressions, I only managed to use IF expressions, which seams to be mandatory of both TRUE and FALSE condition. So the sollution was to go into grasshopper, read custom expressions (which you have to do trough string) and than create a custom xml file which could be loaded inside archicad expressions. The given xml file contains a series of nested IF statements, which is quite hard to follow as such. I do believe python wrapper could access all of those informations from AC and make this task quite easy.

I am sorry if I missed some potential options which could solve this issue in a different manner.
Regards,
P
Ben Cohen
Advocate
Hi

As a long time GDL developer this is very very exciting!!
Giving us the power of the API with something like python would just be amazing.
I have so many questions, but the main one is when ?
Ben Cohen
Mac and PC
Archicad (Latest Version) aus
www.4DLibrary.com.au