Skip to content

Add SwichDesign automatic dimensions extension#3492

Draft
Swichllc wants to merge 2 commits into
pyrevitlabs:developfrom
Swichllc:develop
Draft

Add SwichDesign automatic dimensions extension#3492
Swichllc wants to merge 2 commits into
pyrevitlabs:developfrom
Swichllc:develop

Conversation

@Swichllc

@Swichllc Swichllc commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

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! 🎉

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.
@devloai

devloai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Unable to trigger custom agent "Code Reviewer". You have run out of credits 😔
Please upgrade your plan or buy additional credits from the subscription page.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 autodimswichdesign helper modules for geometry processing, Revit element/reference discovery, and US-style dimension spacing/formatting rules.
  • Provides a localized bundle.yaml tooltip/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

Comment on lines +4 to +7
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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct - fixtures are partially recognized - still need to improve and for now selection is getting ignored for interior

Comment on lines +37 to +38
ENGINE: IronPython (pyRevit default - NO python3 shebang; CPython engine
is broken in this environment, PROJECT_BRIEF.md sections 13-16).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Project Brief was used for internal developing process and is not required for plugin operation

Comment on lines +65 to +68
# 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.
Comment thread extensions/SwichDesign.extension/lib/autodimswichdesign/standards.py Outdated
# -*- coding: utf-8 -*-
"""Pure geometry logic for the Automatic Dimensions rules.

Zero Revit dependency - unit-tested anywhere (tests/test_geometry.py).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"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

Comment on lines +348 to +365
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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@Wurschdhaud

Copy link
Copy Markdown
Contributor

General opinion:

  • I wouldn't add a new extension folder to the repo, either find a place or have it a separate repo
  • as it's US only, it may be too specific for the general tools?
  • as all other tools are translated by now, the resource dictionaries for other languages should be in there. Don't know if it's US only though.
  • if there's an actual issue like this title indicates def pyrevit_config_broken(): I'd try to fix that instead of some workaround
  • as this is a new tool, I wouldn't leave stuff like saved by older versions which indicates iterations during development in there
  • if libs aren't actually reusable by other tools, just place them in the same .pushbutton folder
  • I'd rely on internal tools DB.UnitFormatUtils instead of custom stuff like this def format_ft_in(value_ft):

@Swichllc
Swichllc marked this pull request as draft July 21, 2026 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants