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 |
| 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
| # -*- 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
Removal of text pointing to internal document Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
General opinion:
|
|
@Swichllc I agree with @Wurschdhaud comments and more importantly on
|
Move the Automatic Dimensions tool from SwichDesign.extension into pyRevitTools.extension and register it in the Drawing Set panel. Rename the package to autodim and refactor internals: add a document-scoped opening index with reset_opening_cache(), switch to a document-aware format_length (uses pyrevit DB/DOCS/HOST_APP), and replace the tool's custom settings persistence with pyrevit's script.get_config()/script.save_config(). Miscellaneous docstring/comment cleanup and other small fixes to improve performance and correctness.
|
@jmcouffin @Wurschdhaud I believe I addressed all the comments if you guys want to take a look |
|
|
||
| AUTO_OFFSET_LABEL = "Auto (by view scale)" | ||
|
|
||
| XAML = os.path.join(os.path.dirname(__file__), "AutoDimWindow.xaml") |
There was a problem hiding this comment.
script.get_bundle_file() does the same - minor nitpick
There was a problem hiding this comment.
@Wurschdhaud I would not be able to get to it this week, (claude usage limits nonsense - coding by vibes only:) Would you be able to check if making your changes affect the tool?
and regarding where it is going to be - I have no issue to move it - I was just trying to keep it visible, from my personal experience, the buried dropdown tools are not easy to find unless you know exactly where the tool is.
Thanks
There was a problem hiding this comment.
For the visibility, good comms at release plus a video and some social media can get you a long way
- black formatting - move lib stuff one layer up - add context to bundle file - move format helper to units.py - simplify some imports and general handling
|
Implemented what jumped into my eye, still seems to work, give it a swing. Note:
|
|
@Wurschdhaud thank you for taking care of that - I went over it, tested it, seem to work as before, so I'm good on my end. Thank you |
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! 🎉