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

How to auto-number elements along a polyline in Archicad with Tapir and Python

0 Likes

Automating ID assignment for multiple model elements can significantly reduce manual work and errors, especially when a clear spatial sequence is required (for example, rooms along a corridor, parking spaces along a lane, or furniture along a path). This article describes how element IDs can be automatically assigned based on their sequential position along a polyline in Archicad, using a Python script and the Tapir plugin. The method helps maintain consistent ordering across large projects while minimizing repetitive manual renumbering.

 

Issue description

 

Managing large sets of elements often requires a logical ID sequence, but assigning those IDs manually is time‑consuming and inconsistent. Numbering rooms, parking spots, or furniture items one by one increases the risk of gaps, duplicates, and ordering mistakes, especially when changes occur during design development. Maintaining a clear spatial sequence across the project becomes an additional coordination task instead of a background operation.

 

Solution

 

A Python script integrated with the Tapir plugin enables automatic numbering of selected elements according to their position along a polyline placed in the floor plan. he workflow was developed and shared by Community members, @Mathias Jonathan and @Tibor Lorantfy, using Tapir to connect Python with the running Archicad instance and process element geometry. Once configured, the script replaces manual renumbering with a repeatable, model‑driven operation that preserves spatial logic.

 

Requirements 

 

Python

  • Install the latest Python version from python.org for the relevant operating system.
  • During installation, the “Add Python to PATH” option must be enabled to allow the script to run from the system environment.

 

Tapir plugin

  • Download the Tapir Archicad automation plugin from the Tapir GitHub repository and complete installation using the provided setup guide.

 

Steps to use the script

 

  1. Download the Python script (comes packaged with Tapir in its latest version)
    Download

  2. Place a polyline in your floor plan – no separate object is required (as the script now works directly with polylines).

    MolindaPrey_0-1756413889743.png

     

  3. Select elements and the polyline you want to use as the numbering guide.

    • For labels, use the Label Tool; these are not generated automatically by the script.

      MolindaPrey_1-1756413906734.png

       

  4. Run the script

    • Open via the Python Palette or double-click the .py file.

    • It will connect with the running Archicad instance.

      MolindaPrey_2-1756413926154.png

       

  5. Enter the starting number when prompted (e.g., 1, 101, etc.).

    MolindaPrey_3-1756413942228.png

     

The script then automatically updates element IDs based on their sequential position along the polyline.

 

How the script works

 

  • Collects polyline coordinates.

  • Identifies the center point of each selected element.

  • Matches each element to the closest point along the polyline.

  • Sorts elements in order along the polyline.

  • Assigns element IDs in that spatial order.

 

Result

 

This workflow transforms what is normally a slow, manual operation into a streamlined automated process. Elements are numbered consistently, errors are reduced, and spatial logic is preserved throughout the project. Whether numbering rooms, parking spaces, or pieces of furniture, this approach delivers both speed and accuracy.

 

 

MolindaPrey_4-1756413971469.png

 


These techniques were originally shared by Community member @Mathias Jonathan. If you’d like to explore the original discussion, click here to read the full thread!

 

This article is part of the ‘Tip of the Month’ series on Graphisoft Insights, highlighting valuable community-driven solutions for modeling challenges. Try these methods in your next project and experience the difference in model quality and efficiency.

Still looking?

Browse more articles

Back to articles

See latest solutions

Accepted solutions

Start a new discussion!