Skip to content

Update Renumber tool to handle multiple open UI Views in the Active U…#2679

Merged
jmcouffin merged 4 commits intopyrevitlabs:developfrom
tay0thman:patch-22
May 29, 2025
Merged

Update Renumber tool to handle multiple open UI Views in the Active U…#2679
jmcouffin merged 4 commits intopyrevitlabs:developfrom
tay0thman:patch-22

Conversation

@tay0thman
Copy link
Copy Markdown
Contributor

@tay0thman tay0thman commented May 27, 2025

…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:

  • 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.

Related Issues

If applicable, link the issues resolved by this pull request:

  • Resolves #[issue number]

Additional Notes

Include any additional context, screenshots, or considerations for reviewers.


Thank you for contributing to pyRevit! 🎉

@devloai
Copy link
Copy Markdown
Contributor

devloai bot commented May 27, 2025

Unable to perform a code review. You have run out of credits 😔
You can buy additional credits from the subscription page.

@jmcouffin jmcouffin requested a review from Copilot May 28, 2025 06:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_handles and 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_View to ui_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[...] and rr_int.Visible[...] later in this function are outside the loop, so they only apply to the last target_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():

tay0thman and others added 2 commits May 28, 2025 07:35
…t2.stack/ReNumber.pushbutton/script.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Resolving comments from DevloAI
Copy link
Copy Markdown
Contributor Author

@tay0thman tay0thman left a comment

Choose a reason for hiding this comment

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

Resolved concerns from Devlo

@jmcouffin
Copy link
Copy Markdown
Contributor

I will check and merge it tomorrow, thanks @tay0thman

Copy link
Copy Markdown
Contributor

@jmcouffin jmcouffin left a comment

Choose a reason for hiding this comment

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

All good
Tested and work as expected
Thanks @tay0thman

@jmcouffin jmcouffin merged commit a62ca46 into pyrevitlabs:develop May 29, 2025
@jmcouffin jmcouffin added Enhancement Enhancement request [class->Improved #{number}: {title}] Tools Issues related to pyRevit commands [subsystem] labels May 29, 2025
@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25149+1012-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25149+1943-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 2, 2025

📦 New work-in-progress (wip) builds are available for 5.1.0.25153+1459-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 3, 2025

📦 New work-in-progress (wip) builds are available for 5.1.0.25154+0858-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 3, 2025

📦 New work-in-progress (wip) builds are available for 5.1.0.25154+0920-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 4, 2025

📦 New work-in-progress (wip) builds are available for 5.1.0.25155+0904-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25162+1125-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25162+1306-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25162+2030-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25164+0700-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25164+1347-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25164+1420-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25164+1830-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.1.0.25171+0757-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25181+1313-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New public release are available for 5.2.0.25181+1425

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.

[Bug]: Renumber tool over multiple views doesn't restore roomcolor in inactive views

3 participants