Update Renumber tool to handle multiple open UI Views in the Active U…#2679
Update Renumber tool to handle multiple open UI Views in the Active U…#2679jmcouffin merged 4 commits intopyrevitlabs:developfrom
Conversation
|
Unable to perform a code review. You have run out of credits 😔 |
There was a problem hiding this comment.
Pull Request Overview
The PR extends the Renumber tool to operate across all open UI views instead of a single active view.
- Adds
get_open_views()to collect multiple open views. - Refactors
toggle_element_selection_handlesand related routines to loop over view lists. - Updates context manager and renumbering calls to use lists of views.
Comments suppressed due to low confidence (3)
extensions/pyRevitTools.extension/pyRevit.tab/Modify.panel/edit2.stack/ReNumber.pushbutton/script.py:47
- [nitpick] PEP 8 recommends lowercase with underscores for variable names; consider renaming
ui_Viewtoui_view.
for ui_View in ui_views:
extensions/pyRevitTools.extension/pyRevit.tab/Modify.panel/edit2.stack/ReNumber.pushbutton/script.py:63
- The calls to
rr_cat.Visible[...]andrr_int.Visible[...]later in this function are outside the loop, so they only apply to the lasttarget_view; move those visibility toggles inside the same loop to apply to every view.
target_view.EnableTemporaryViewPropertiesMode(target_view.Id)
extensions/pyRevitTools.extension/pyRevit.tab/Modify.panel/edit2.stack/ReNumber.pushbutton/script.py:39
- New multi-view behavior should have accompanying tests—e.g., mocking multiple open views—to ensure the refactored loops correctly handle all cases.
def get_open_views():
...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
Show resolved
Hide resolved
...ns/pyRevitTools.extension/pyRevit.tab/Modify.panel/edit2.stack/ReNumber.pushbutton/script.py
Show resolved
Hide resolved
…t2.stack/ReNumber.pushbutton/script.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Resolving comments from DevloAI
tay0thman
left a comment
There was a problem hiding this comment.
Resolved concerns from Devlo
...ns/pyRevitTools.extension/pyRevit.tab/Modify.panel/edit2.stack/ReNumber.pushbutton/script.py
Show resolved
Hide resolved
|
I will check and merge it tomorrow, thanks @tay0thman |
jmcouffin
left a comment
There was a problem hiding this comment.
All good
Tested and work as expected
Thanks @tay0thman
|
📦 New work-in-progress (wip) builds are available for 5.1.0.25149+1012-wip |
|
📦 New work-in-progress (wip) builds are available for 5.1.0.25149+1943-wip |
|
📦 New work-in-progress (wip) builds are available for 5.1.0.25153+1459-wip |
|
📦 New work-in-progress (wip) builds are available for 5.1.0.25154+0858-wip |
|
📦 New work-in-progress (wip) builds are available for 5.1.0.25154+0920-wip |
|
📦 New work-in-progress (wip) builds are available for 5.1.0.25155+0904-wip |
|
📦 New work-in-progress (wip) builds are available for 5.1.0.25162+1125-wip |
|
📦 New work-in-progress (wip) builds are available for 5.1.0.25162+1306-wip |
|
📦 New work-in-progress (wip) builds are available for 5.1.0.25162+2030-wip |
|
📦 New work-in-progress (wip) builds are available for 5.1.0.25164+0700-wip |
|
📦 New work-in-progress (wip) builds are available for 5.1.0.25164+1347-wip |
|
📦 New work-in-progress (wip) builds are available for 5.1.0.25164+1420-wip |
|
📦 New work-in-progress (wip) builds are available for 5.1.0.25164+1830-wip |
|
📦 New work-in-progress (wip) builds are available for 5.1.0.25171+0757-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25181+1313-wip |
|
📦 New public release are available for 5.2.0.25181+1425 |
…I Document
Update Renumber tool to handle multiple open UI Views in the Active UI
Description
Replacing the Active View with a List of Views,
1- Collecting open views.
2- Looping through the list of view
3- Toggling Temporary view templates one by one.
Although looping is not the most efficient approach, it is more streamlined and less reliant on complex data structures, also the performance hit will be minimal since I won't anticipate a project will have more than a dozen of views open.
2025-05-27.14-55-40.mp4
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! 🎉