-
Open the script
Install the Tapir Add-On with the Tapir Installer, as Get started shows, and start Archicad with a project open. Choose Tapir Palette from the Tapir menu.
Door and Window Numbering by Zone is a built-in script: open the floor plan, pick DoorWindowNumberingByZone in the palette's list and click Run Script. It reads the doors and windows of the current story and shows the new IDs next to the current ones; nothing is changed yet. It is also on the Scripts page as Door and Window Numbering by Zone.
-
Choose the elements
In Elements, choose Selection, Current story or Whole project, then press Read elements.
-
Set the patterns
The list of new IDs updates as you type.
- Doors and Windows are the patterns of the IDs,
{zone}-D{n}and{zone}-W{n}at first.{zone}is the zone number,{name}the zone name (also used for{zone}when the zone has no number) and{n}the running number within the zone. - Start at is the first number in each zone, 1 at first.
- Digits is the least number of digits of
{n}, padded with zeros: 2 gives01.
The script warns when new IDs repeat.
- Doors and Windows are the patterns of the IDs,
-
Rename
Press Rename and confirm. The script changes the Element ID of each door and window whose new ID differs from the current one, and you can undo it in Archicad. The status column shows the elements that could not be changed and why. In a Teamwork project, an element you have not reserved may not be changed.
How it finds the zone.
Each door or window belongs to the zone on its "to" side, or to the zone on its "from" side when there is none. Within a zone they are numbered clockwise around the zone stamp, starting from the north. Zones with the same number continue one count, from north to south. Doors and windows without a zone are listed separately, with the reason, and are not renamed. Skylights and curtain wall panels are not numbered.
The script reads the zones of the doors and windows with GetRelationsOfElements and their positions with Get3DBoundingBoxes, and writes the IDs with SetElementInfoStrings. Its code is builtin-scripts/DoorWindowNumberingByZone.py. It works in Archicad 26 to 30 with Tapir 1.8.0 or later; Archicad 25 cannot tell which zone a door or window opens into.