Skip to content

Commit

Permalink
Now 'Query View Elements' filters out hidden on UI categories.
Browse files Browse the repository at this point in the history
  • Loading branch information
kike-garbo committed Jul 28, 2023
1 parent 0b40770 commit 300ed60
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/pages/_en/1.0/reference/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ group: Deployment & Configs
- Added 'Component Reference Plane' component.
- Added 'Reference Annotations' component.
- Improved 'Host Shape' performance.
- Now 'Query View Elements' filters out hidden on UI categories.

{% endcapture %}
{% include ltr/release_header_next.html title="Upcoming Changes" note=rc_release_notes %}
Expand Down
9 changes: 9 additions & 0 deletions src/RhinoInside.Revit.GH/Components/Element/QueryElements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,15 @@ protected override void TrySolveInstance(IGH_DataAccess DA)
ERDB.CompoundElementFilter.ElementCategoryFilter(ids, inverted: false, view.Document.IsFamilyDocument)
);
}
else
{
// Default category filtering
var hiddenCategories = BuiltInCategoryExtension.GetHiddenInUIBuiltInCategories(view.Document) as ICollection<ARDB.BuiltInCategory>;
elementCollector = elementCollector.WherePasses
(
new ARDB.ElementMulticategoryFilter(hiddenCategories, inverted: true)
);
}

if (filter is object)
elementCollector = elementCollector.WherePasses(filter);
Expand Down

0 comments on commit 300ed60

Please sign in to comment.