Add SwichDesign automatic dimensions extension#3492
Conversation
Add SwichDesign.extension with automatic dimensioning for Revit. Includes three main library modules (geometry, revit_io, standards) providing pure geometry algorithms, Revit API integration, and US architectural dimensioning standards. The main button implements exterior (multi-tier wall/opening dimensions) and interior (room-driven) dimensioning modes with support for angled buildings via frame transformations, core/finish face selection, and opening dimensioning modes. Update .gitignore to allow this extension in the repository.
|
Unable to trigger custom agent "Code Reviewer". You have run out of credits 😔 |
There was a problem hiding this comment.
Pull request overview
Adds a new SwichDesign.extension button under the main pyRevit tab to automatically place exterior and interior dimension strings in Revit floor plans, backed by a small internal library split into geometry (pure algorithms), Revit API I/O, and dimensioning standards.
Changes:
- Introduces the Automatic Dimensions pushbutton script with exterior (multi-tier) and interior (room-driven) modes plus a WPF configuration dialog.
- Adds
autodimswichdesignhelper modules for geometry processing, Revit element/reference discovery, and US-style dimension spacing/formatting rules. - Provides a localized
bundle.yamltooltip/title describing usage and behavior.
Reviewed changes
Copilot reviewed 6 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| extensions/SwichDesign.extension/pyRevit.tab/Drawing Set.panel/Automatic Dimensions.pushbutton/script.py | Main tool entrypoint, UI wiring, and exterior/interior dimension placement logic |
| extensions/SwichDesign.extension/pyRevit.tab/Drawing Set.panel/Automatic Dimensions.pushbutton/bundle.yaml | Button metadata + localized tooltip/help text |
| extensions/SwichDesign.extension/pyRevit.tab/Drawing Set.panel/Automatic Dimensions.pushbutton/AutoDimWindow.xaml | WPF dialog for mode/options (core/finish, RO/CL, offsets, dry run) |
| extensions/SwichDesign.extension/lib/autodimswichdesign/standards.py | Dimension spacing presets + parsing/formatting helpers |
| extensions/SwichDesign.extension/lib/autodimswichdesign/revit_io.py | Revit API integration for walls/openings/rooms/faces and dimension creation |
| extensions/SwichDesign.extension/lib/autodimswichdesign/geometry.py | Pure geometry pipeline (segment ordering/splitting, tier building, room polygon math) |
| extensions/SwichDesign.extension/lib/autodimswichdesign/init.py | Package marker for autodimswichdesign |
| FLOW: optionally select walls (plus fixtures/casework for interior mode), | ||
| click the button, choose Exterior or Interior in one dialog (with Dry-run | ||
| and R.O. toggles), done. Nothing selected = auto-detect all exterior | ||
| walls and dimension the whole building perimeter. |
There was a problem hiding this comment.
That is correct - fixtures are partially recognized - still need to improve and for now selection is getting ignored for interior
| ENGINE: IronPython (pyRevit default - NO python3 shebang; CPython engine | ||
| is broken in this environment, PROJECT_BRIEF.md sections 13-16). |
There was a problem hiding this comment.
Project Brief was used for internal developing process and is not required for plugin operation
| # every save is SILENTLY skipped (live-diagnosed on the user's Revit | ||
| # machine: null-byte ini -> "menu does not save previous selection"; | ||
| # traced in pyRevit 6.5.3 userconfig.py, PROJECT_BRIEF session 42). | ||
| # One json file per user under %APPDATA% is immune to all of it. |
| # -*- coding: utf-8 -*- | ||
| """Pure geometry logic for the Automatic Dimensions rules. | ||
|
|
||
| Zero Revit dependency - unit-tested anywhere (tests/test_geometry.py). |
There was a problem hiding this comment.
"Dry run" feature the testing and the ability o run the code without populating the model - testing for issues with the model geometry that might lead to failure
| def get_hosted_openings(wall, doc, doors_only=False): | ||
| """Door/window FamilyInstances hosted by this wall.""" | ||
| if doors_only: | ||
| categories = (BuiltInCategory.OST_Doors,) | ||
| else: | ||
| categories = (BuiltInCategory.OST_Doors, | ||
| BuiltInCategory.OST_Windows) | ||
| found = [] | ||
| for bic in categories: | ||
| collector = (FilteredElementCollector(doc) | ||
| .OfCategory(bic) | ||
| .WhereElementIsNotElementType()) | ||
| for inst in collector: | ||
| if (isinstance(inst, FamilyInstance) | ||
| and inst.Host is not None | ||
| and inst.Host.Id == wall.Id): | ||
| found.append(inst) | ||
| return found |
There was a problem hiding this comment.
The process is extremely fast, it was tested on a very large model with results done in seconds, it is bound for the view and selected walls only for exterior - and per room for interior - I see no reason for changing the working method
Removal of text pointing to internal document Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
General opinion:
|
automatic dimensions extension
Description
Added SwichDesign.extension with automatic dimensioning for Revit. Includes three main library modules (geometry, revit_io, standards) providing pure geometry algorithms, Revit API integration, and US architectural dimensioning standards. The main button implements exterior (multi-tier wall/opening dimensions) and interior (room-driven) dimensioning modes with support for angled buildings via frame transformations, core/finish face selection, and opening dimensioning modes.
Checklist
Need community help with testing, UI and the extension location
USER_GUIDE.md
in the main pyrevit tab
Additional Notes
Include any additional context, screenshots, or considerations for reviewers.
Auto.Dim.v3.mp4
Thank you for contributing to pyRevit! 🎉