Automatic Dimensions — Swich Design pyRevit Extension
Short demo : https://youtu.be/v7vOXhg8PAg
Open-source pyRevit extension that codifies US construction-document dimensioning conventions as an auditable, deterministic rule engine — no AI in the placement logic.
One button — Automatic Dimensions (pyRevit tab → Drawing Set panel), one dialog, two modes:
- Exterior — select the perimeter walls of a level; the tool chains them, groups them by facing direction (angled wings get their own correctly-rotated frames), and places a stacked 3-tier string per side: jogs + openings / jogs only / overall. First-string offset and tier spacing are configurable in paper inches, with per-view-scale presets. On large multi-mass plans, sides split automatically so witness lines never cross another selected wall. (The wall type's Function parameter is deliberately ignored — it is unreliable in real models, so exterior mode always works from your selection.)
- Interior — driven entirely by placed Rooms: room lengths on both axes (placed at the room's quarter lines), one opening string per room wall with doors/windows, and center-to-nearest-wall dimensions for fixtures, casework and columns.
Both modes: measure to finish faces or calibrated core (stud) faces; openings to centreline or rough-opening jambs; dry run prints a full report with zero model changes; every skipped or failed string is reported by name — nothing fails silently.
Out of scope for v1: curved walls (skipped with a note).
SwichDesign.extension/
├── lib/autodimswichdesign/
│ ├── geometry.py pure Python rule math — no Revit imports, unit-tested
│ ├── standards.py dimensioning constants (paper-space, × View.Scale)
│ └── revit_io.py ALL Revit API touchpoints (extraction + placement)
└── pyRevit.tab/Drawing Set.panel/Automatic Dimensions.pushbutton/
├── script.py IronPython button: UI + orchestration only
├── AutoDimWindow.xaml the WPF dialog
├── bundle.yaml localised title/tooltip (8 locales)
├── icon.png light theme
└── icon.dark.png dark theme
The tab/panel folders deliberately mirror pyRevit's own names (pyRevit.tab,
Drawing Set.panel), so the button merges into pyRevit's existing Drawing Set
panel rather than creating a tab of its own — pyRevit merges panels by name
(loader/uimaker.py calls create_ribbon_panel(..., update_if_exists=True)).
pyRevit tab → Settings → Custom Extension Directories → add this repo's
root folder (the one containing SwichDesign.extension) → Save → Reload.