feat: Print Sheets: DWG exporter, progress bar, crash prevention + more#2864
feat: Print Sheets: DWG exporter, progress bar, crash prevention + more#2864jmcouffin merged 18 commits intopyrevitlabs:developfrom
Conversation
1. Added DWG exporter 2. Added progress bar (which can be cancelled) 3. Prevent built in naming formats from being deletes (deleting all naming formats previously caused Revit to crash). 4. Sheet Revision Column now sorts by date (DD.MM.YY or DD/MM/YY or MM.DD.YY or MM/DD/YY) US version is untested 5. Reordered sheet revision to be (Date, Rev, Description) 6. Made Print Sheets form wider
1. Added DWG exporter 2. Added progress bar (which can be cancelled) 3. Prevent built in naming formats from being deletes (deleting all naming formats previously caused Revit to crash). 4. Sheet Revision Column now sorts by date (DD.MM.YY or DD/MM/YY or MM.DD.YY or MM/DD/YY) US version is untested 5. Reordered sheet revision to be (Date, Rev, Description) 6. Made Print Sheets form wider
There was a problem hiding this comment.
PR Summary:
This PR adds valuable enhancements to the Print Sheets tool:
- DWG export functionality alongside PDF export
- Progress bars with cancellation support for better UX
- Crash prevention by blocking deletion of built-in naming formats
- Sortable revision dates (Date, Rev, Description order)
- Wider form window (1500px) for better visibility
Review Summary:
Identified several critical issues that need attention before merging. The main concerns are:
- Global document variables that can become stale in IronPython's persistent script environment
- Duplicate imports causing shadowing issues
- Missing error handling around export operations that could crash the script
- Dynamic attribute assignment without proper initialization
The review focused on IronPython-specific patterns, exception handling standards, and code quality per the pyRevit coding guidelines. Overall, the new features are well-implemented but need these fixes to ensure reliability.
Follow-up suggestions:
@devloai fix the identified critical issues- Address the global variables, imports, error handling, and attribute initialization@devloai ensure black formatting and PEP 8 compliance- Clean up code style issues (imports on one line, naming conventions, spacing)
...sions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/Print Sheets.pushbutton/script.py
Outdated
Show resolved
Hide resolved
...sions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/Print Sheets.pushbutton/script.py
Outdated
Show resolved
Hide resolved
...sions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/Print Sheets.pushbutton/script.py
Outdated
Show resolved
Hide resolved
...sions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/Print Sheets.pushbutton/script.py
Show resolved
Hide resolved
...yRevitTools.extension/pyRevit.tab/Drawing Set.panel/Print Sheets.pushbutton/PrintSheets.xaml
Outdated
Show resolved
Hide resolved
...sions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/Print Sheets.pushbutton/script.py
Outdated
Show resolved
Hide resolved
|
@devloai code review please against pyrevit's standards |
|
Unable to address comment. You have run out of credits 😔 |
|
Satisfied the improvements work in Revit 2022-2025. Would benefit from someone checking in 2026, and that the dates can be ordered based on MM.DD.YY dating format |
...sions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/Print Sheets.pushbutton/script.py
Outdated
Show resolved
Hide resolved
Replaced can_print method with version_check_2022 to ensure compatibility with Revit 2022 or later. Updated print logic to handle printing based on Revit version. - Post Revit, print PDFs & DWGs to custom folder - Pre 2022, prints PDF to printer driver's default location, print DWG to custom folder
|
IMO, You could dismiss the pre2022 logic anyway. We can't realistically support all previous behaviour while maintaining and improving the tools. |
I agree with that principle moving forward. Though since it is already done, I'm happy to leave it in. Unless you want it removed. |
|
Leave it for now, this is fine. |
…stant for improved readability and performance.
…ross-platform compatibility and readability.
…text for better clarity and consistency.
…rity and consistency, and enhance locale detection logic.
|
Did some cleanup |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25307+2045-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.0.25307+2237-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.0.25308+0721-wip |
|
📦 New public release are available for 5.3.0.25307+2146 |
Print Sheets
Description
Checklist
Before submitting your pull request, ensure the following requirements are met:
pipenv run black {source_file_or_directory}Additional Notes