cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

License delivery maintenance is planned for Saturday, July 26, between 12:00 and 20:00 CEST. During this time, you may experience outages or limited availability across our services, including BIMcloud SaaS, License Delivery, Graphisoft ID (for customer and company management), Graphisoft Store, and BIMx Web Viewer. More details…

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

[SCRIPT] Auto-numbering elements using a polyline using Tapir

I created a "proof of concept" with claude AI for automatic numbering the element ID using proximity to a polyline.

 

How to use the script?

-Place the gdl object "AutomaticNumberingPolyline" (This is a renamed version of SinceV6 polyline object that you can find here ) on the floor plan.

-Select the object "AutomaticNumberingPolyline" and the elements to number.

-Launch the script (Python palette or double click on the script (The script will work on the first opened archicad instance)

-When asked, Enter the starting number for the first element

-Done

 

here is a video example (Please forgive my English, we're not very well known for our linguistic talents in France.^^):

 

How to install the script?

-Install the last version of Python 

-Install the last version of the Tapir Plugin (Opensource plugin that gives access to new python commands in archicad that are needed for this script)

 

(Optionnal for easy use if you have a subscription or SSA)

-How to show the python palette 

 

How does the script work?

 

1-Recover the coordinates of a polyline object coordinates stored in the object's GDL parameters and retrieved with the corresponding Tapir command
2-Recover the C centers of the 2D bounding boxes of each object to be numbered O
3-Find the nearest point P on the polyline for each C-center
4-Determine the relative position of each point P along the polyline
5-Sort objects O according to this position
6-Number the objects in this order

 

Thanks a lot to the Tapir team, especially @Tibor Lorantfy@Viktor Kovacs, and @jorgebeneitez.

 

 

Archicad 27 - GDL - PYTHON
14 REPLIES 14
scottjm
Advisor

Wow nice! This is a very interesting and exciting proof of concept. 

The thing about these creations is they unfortunately aren’t particularly accessible for a basic user. (Ie the user needs to have python and tapir installed and know how to open the python palette and find the script and run it) But to make them accessible basically means you’d have to write the whole thing in c++ as a full blown addon. Python is so much nicer to code in. 

Scott J. Moore | Fulton Trotter Architects | BIM Manager, Associate, Architect
Since AC13 | Current versions AC23.7000 & AC26.5002 | BIMCloud Basic | Python, GDL, VBA, PHP, SQL, CSS
Certified Graphisoft BIM Manger (2022)
Win 10, i9-9900K, 32GB, Quadro P2200, 500GB NVMe

Tapir's development team has created a much more accessible palette for launching scripts (in progress). Graphisoft will be releasing an addon store, which should help deploy this kind of solution.

I've modified the script to use a real polyline instead of an object, which should make it much easier to use.

I'll share this new version once the new Tapir update is stable.

 

The other advantage of python is that you can quickly ask the AI to code these scripts, if you give it the missing part: the connection between archicad and python.
With a library of simple scripts, it's easy to imagine “power users” creating tailor-made tools for their colleagues.

Archicad 27 - GDL - PYTHON

And I think that the big issue is not to give a new tool that can be used “passively”, but rather a new opportunity for “power users” to propose new things, and to share them, by lowering the barrier of necessary knowledge (C++ to Python).

Archicad 27 - GDL - PYTHON
Guillermo1
Enthusiast

Hello, i can´t load the .gsm file in to archicad 26

Hi! If you use the last official version of tapir, you won't need to download the script or an object: the script is part of the official package and now works with one polyline (the tool, not an object).

Archicad 27 - GDL - PYTHON
Guillermo1
Enthusiast

oh thanks, how can i install tapir?

Nathanael_Hervouet
Graphisoft
Graphisoft

Hi @Mathias Jonathan , 
Thank you for your work and for sharing !
I'm very interested in this script.

It works, but I have an interface issue : I can't see the panel to start numbering. 
I'm working on macOS 15.5 Sequoia, and I have the same with both Archicad 27 and 28.
What can we do about it ?
Capture d’écran 2025-07-01 à 08.45.21.png

Senior Customer Success Manager, Graphisoft Switzerland

You have 2 different versions of the script: the Beta2 is outdated, the tapir one on the right seems to be the last one. Do you know which version you used?

NB: On peut faire une visio si tu veux.  We can make a video if you want

 

@Guillermo1 Here: https://github.com/ENZYME-APD/tapir-archicad-automation 

Archicad 27 - GDL - PYTHON

I used the SCRIPT_AutomaticNumberingBeta2.py as I could download the script from this page : Tip of the Month: Auto-number elements using a polyline in Archicad
Where can I get the latest script ?

Senior Customer Success Manager, Graphisoft Switzerland