Skip to content

feat: Print Sheets: DWG exporter, progress bar, crash prevention + more#2864

Merged
jmcouffin merged 18 commits intopyrevitlabs:developfrom
WemyssJ:develop
Nov 3, 2025
Merged

feat: Print Sheets: DWG exporter, progress bar, crash prevention + more#2864
jmcouffin merged 18 commits intopyrevitlabs:developfrom
WemyssJ:develop

Conversation

@WemyssJ
Copy link
Copy Markdown
Contributor

@WemyssJ WemyssJ commented Oct 14, 2025

Print Sheets

Description

  1. Added DWG export option
  2. Added progress bar (which can be cancelled)
  3. Prevent built in naming formats from being deleted (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
  7. PDFs and DWGs go to predefined folder which opens on print for easier access

Checklist

Before submitting your pull request, ensure the following requirements are met:

  • Code follows the PEP 8 style guide.
  • Code has been formatted with Black using the command:
    pipenv run black {source_file_or_directory}
  • Changes are tested and verified to work as expected.

Additional Notes

  • Tested in Revit 2022-2025.
  • Sheet Revision sort by works for DD.MM.YY (not tested for MM.DD.YY)

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
@jmcouffin jmcouffin marked this pull request as draft October 14, 2025 10:38
Copy link
Copy Markdown
Contributor

@devloai devloai bot left a comment

Choose a reason for hiding this comment

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

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:

  1. Global document variables that can become stale in IronPython's persistent script environment
  2. Duplicate imports causing shadowing issues
  3. Missing error handling around export operations that could crash the script
  4. 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)

@WemyssJ WemyssJ marked this pull request as ready for review October 14, 2025 18:30
@WemyssJ WemyssJ marked this pull request as draft October 14, 2025 19:37
@WemyssJ
Copy link
Copy Markdown
Contributor Author

WemyssJ commented Oct 14, 2025

@devloai code review please against pyrevit's standards

@devloai
Copy link
Copy Markdown
Contributor

devloai bot commented Oct 14, 2025

Unable to address comment. You have run out of credits 😔
Please upgrade your plan or buy additional credits from the subscription page.

@WemyssJ WemyssJ marked this pull request as ready for review October 15, 2025 09:02
@WemyssJ
Copy link
Copy Markdown
Contributor Author

WemyssJ commented Oct 15, 2025

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

@jmcouffin jmcouffin changed the title Print Sheets: DWG exporter, progress bar, crash prevention + more feat: Print Sheets: DWG exporter, progress bar, crash prevention + more Oct 16, 2025
@jmcouffin jmcouffin added Tools Issues related to pyRevit commands [subsystem] New Feature New feature request [class->Implemented #{number}: {title}] Enhancement Enhancement request [class->Improved #{number}: {title}] and removed New Feature New feature request [class->Implemented #{number}: {title}] labels Oct 16, 2025
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
@jmcouffin
Copy link
Copy Markdown
Contributor

IMO, You could dismiss the pre2022 logic anyway. We can't realistically support all previous behaviour while maintaining and improving the tools.
I don't mind if tools support only 3 versions back, the EULA of Revit states that anyway.

@WemyssJ
Copy link
Copy Markdown
Contributor Author

WemyssJ commented Oct 16, 2025

IMO, You could dismiss the pre2022 logic anyway. We can't realistically support all previous behavior while maintaining and improving the tools. I don't mind if tools support only 3 versions back, the EULA of Revit states that anyway.

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.

@jmcouffin
Copy link
Copy Markdown
Contributor

Leave it for now, this is fine.

@jmcouffin
Copy link
Copy Markdown
Contributor

Did some cleanup
Cool addition, thanks @WemyssJ

@jmcouffin jmcouffin merged commit e4a880a into pyrevitlabs:develop Nov 3, 2025
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 3, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25307+2045-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 3, 2025

📦 New work-in-progress (wip) builds are available for 5.3.0.25307+2237-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 4, 2025

📦 New work-in-progress (wip) builds are available for 5.3.0.25308+0721-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 4, 2025

📦 New public release are available for 5.3.0.25307+2146

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement Enhancement request [class->Improved #{number}: {title}] Tools Issues related to pyRevit commands [subsystem]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants