-
-
Notifications
You must be signed in to change notification settings - Fork 405
Fix override graphics behaviour for renumber tool #2956
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
…s, like unmark - store the current override if any to restore during unmark
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary:
Fixes override graphics behavior in the renumber tool by:
- Adding
AreaPlanandThreeDview types toget_open_views()to fix issue #2951 - Changing marking to affect all open views instead of just the active view
- Storing and restoring original element override states instead of resetting to defaults
- Refactoring
renumbered_element_idsfrom list to dict structure to track per-element, per-view overrides
Review Summary:
Found one critical bug in the door_by_room_renumber() function where the refactoring was incomplete - the data structure was changed from list to dict but the code still uses .append() which will cause a runtime crash. The main pick_and_renumber() logic is sound and correctly captures override states before marking. Also identified a performance optimization opportunity to reduce redundant API calls.
The core fix addresses the reported issue where elements remained visually marked in Area Plan views because those view types weren't included in the unmark operation.
Follow-up suggestions:
@devloai fix the identified issues- Address the critical bug in door_by_room_renumber and the performance optimization
...ns/pyRevitTools.extension/pyRevit.tab/Modify.panel/edit2.stack/ReNumber.pushbutton/script.py
Show resolved
Hide resolved
...ns/pyRevitTools.extension/pyRevit.tab/Modify.panel/edit2.stack/ReNumber.pushbutton/script.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the ReNumber tool's override graphics behavior by adding support for Area Plan and 3D views, applying visual marking across all open views (consistent with the unmark behavior), and preserving custom per-element override settings during the renumber/unmark cycle.
Key Changes
- Extended view type support to include AreaPlan and ThreeD views
- Modified marking behavior to apply across all open views instead of just the active view
- Implemented override state preservation by storing original overrides before marking and restoring them during unmark
...ns/pyRevitTools.extension/pyRevit.tab/Modify.panel/edit2.stack/ReNumber.pushbutton/script.py
Outdated
Show resolved
Hide resolved
...ns/pyRevitTools.extension/pyRevit.tab/Modify.panel/edit2.stack/ReNumber.pushbutton/script.py
Show resolved
Hide resolved
...ns/pyRevitTools.extension/pyRevit.tab/Modify.panel/edit2.stack/ReNumber.pushbutton/script.py
Outdated
Show resolved
Hide resolved
- mark and unmark accept view as var to avoid calling function multiple times - fix missing door implementation for dic instead of list - black format
…point and get_open_views
|
fixed:
additionally: @jmcouffin tested, rerun copilot to verify |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 6 comments.
...ns/pyRevitTools.extension/pyRevit.tab/Modify.panel/edit2.stack/ReNumber.pushbutton/script.py
Outdated
Show resolved
Hide resolved
...ns/pyRevitTools.extension/pyRevit.tab/Modify.panel/edit2.stack/ReNumber.pushbutton/script.py
Show resolved
Hide resolved
...ns/pyRevitTools.extension/pyRevit.tab/Modify.panel/edit2.stack/ReNumber.pushbutton/script.py
Outdated
Show resolved
Hide resolved
...ns/pyRevitTools.extension/pyRevit.tab/Modify.panel/edit2.stack/ReNumber.pushbutton/script.py
Outdated
Show resolved
Hide resolved
...ns/pyRevitTools.extension/pyRevit.tab/Modify.panel/edit2.stack/ReNumber.pushbutton/script.py
Outdated
Show resolved
Hide resolved
...ns/pyRevitTools.extension/pyRevit.tab/Modify.panel/edit2.stack/ReNumber.pushbutton/script.py
Outdated
Show resolved
Hide resolved
- use open_views in renumber for consistency
|
I changed the warning to a progressbar to show the current number. I know that should be a separate PR, since it's no fix but a new feature, but it's a two liner, hope that's ok. |
Great and no worry. If it is not messy, it not an oss nor pyrevit 🤣 |
Description
Checklist
Before submitting your pull request, ensure the following requirements are met:
pipenv run black {source_file_or_directory}Related Issues
If applicable, link the issues resolved by this pull request:
Additional Notes
Include any additional context, screenshots, or considerations for reviewers.
Thank you for contributing to pyRevit! 🎉