cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
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
20 REPLIES 20

Thank you so much, it works! That simply didn't come to my mind, since I assumed I need to use the included "polyline" object. Amazing.