Skip to content

Fix for #2243#2796

Merged
jmcouffin merged 2 commits intopyrevitlabs:developfrom
Wurschdhaud:fix-#2243
Sep 8, 2025
Merged

Fix for #2243#2796
jmcouffin merged 2 commits intopyrevitlabs:developfrom
Wurschdhaud:fix-#2243

Conversation

@Wurschdhaud
Copy link
Copy Markdown
Contributor

Description

Introduces a new function selecting all elements that pass one OR more filters. Only for elements visible in current view.
As described in the issue, you can than hide (HH) or isolate (HI) them to do edit them.


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. - Revit 2024

Related Issues

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


Additional Notes

Translations done by AI.


Thank you for contributing to pyRevit! 🎉

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 introduces a new pyRevit tool "Select All Objects Passing Filter" that addresses issue #2243. The tool allows users to:
• Select multiple Visibility Graphics Filters from a dialog
• Apply OR logic to combine filters using DB.LogicalOrFilter
• Select all elements visible in the active view that match any selected filter
• Enables downstream workflow of hiding (HH) or isolating (HI) filtered elements

Review Summary:

The implementation is functionally sound and follows established pyRevit patterns. The code correctly uses FilteredElementCollector with view scoping, implements proper error handling for edge cases (no filters found, no valid element filters, no matching elements), and provides multi-language support in the bundle configuration. The logic properly addresses the user's workflow need for selecting elements by filter criteria before isolation operations. No critical issues, performance concerns, or logic bugs were identified.

Follow-up suggestions:

@devloai add an icon for the new button to complete the UI integration

@jmcouffin jmcouffin requested a review from Copilot September 5, 2025 19:39
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

This PR introduces a new pyRevit tool that allows users to select all elements in the active view that pass one or more selected filters. The tool addresses issue #2243 by providing a way to select filtered elements for subsequent operations like hiding (HH) or isolating (HI).

  • Adds a new selection tool that combines multiple filters using logical OR operation
  • Restricts selection to elements visible in the current view only
  • Provides multi-language support with AI-generated translations

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
script.py Main implementation that collects filters, allows user selection, combines them with LogicalOrFilter, and selects matching elements in the active view
bundle.yaml Configuration file with multi-language titles and tooltips for the new tool button

@jmcouffin
Copy link
Copy Markdown
Contributor

Simple yet very efficient tool!
Great stuff @Wurschdhaud

@jmcouffin jmcouffin merged commit 615a131 into pyrevitlabs:develop Sep 8, 2025
@jmcouffin jmcouffin added the Tools Issues related to pyRevit commands [subsystem] label Sep 8, 2025
@Wurschdhaud Wurschdhaud deleted the fix-#2243 branch September 8, 2025 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Tools Issues related to pyRevit commands [subsystem]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Isolate or Select By by Visibility Graphics Filter

3 participants