Skip to content

Commit

Permalink
Merge pull request #1078 from mcneel/1.19
Browse files Browse the repository at this point in the history
1.19
  • Loading branch information
kike-garbo authored Feb 27, 2024
2 parents 9a2afd6 + 2f1c4b9 commit 7af5249
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/RhinoInside.Revit.External/DB/CompoundElementFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public static ElementFilter ElementClassFilter(Type type)
else if (typeof(Mullion) == type) return new ElementClassFilter(typeof(FamilyInstance)).Intersect(new ElementCategoryFilter(BuiltInCategory.OST_CurtainWallMullions));
else if (typeof(Panel) == type) return new ElementClassFilter(typeof(FamilyInstance)).Intersect(new ElementCategoryFilter(BuiltInCategory.OST_CurtainWallPanels));
else if (typeof(CurveElement).IsAssignableFrom(type)) return new ElementClassFilter(typeof(CurveElement));
else if (typeof(CombinableElement) == type) return new ElementMulticlassFilter(new Type[] {typeof(GenericForm), typeof(GeomCombination) });
else if (typeof(ElementType) == type) return new ElementIsElementTypeFilter();
else if (typeof(Element) != type) return new ElementClassFilter(type);

Expand Down
12 changes: 8 additions & 4 deletions src/RhinoInside.Revit.GH/Components/Element/Geometry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ internal static IGH_GeometricGoo ToGeometricGoo(GeometryBase geometry)

static readonly ARDB.ElementFilter ElementHasGeometryFilter = CompoundElementFilter.Intersect
(
// Not 100% sure but looks like only elements with category have geometry.
CompoundElementFilter.ElementHasCategoryFilter,
// Not 100% sure but looks like only elements with category or `CombinableElement` have geometry.
CompoundElementFilter.ElementHasCategoryFilter.Union(CompoundElementFilter.ElementClassFilter(typeof(ARDB.CombinableElement))),
CompoundElementFilter.ElementHasBoundingBoxFilter.Union(CompoundElementFilter.ElementClassFilter(typeof(ARDB.FamilySymbol))),
// Types below return no geometry.
new ARDB.ElementMulticlassFilter
Expand Down Expand Up @@ -227,8 +227,12 @@ List<GeometryBase> list
ToGeometryBaseMany
(
x =>
options.View is null ||
!options.View.GetCategoryHidden(GeometryDecoder.Context.Peek.Category.Id)
{
if (options.View is null) return true;
if (GeometryDecoder.Context.Peek.Category is null) return true;
if (!options.View.GetCategoryHidden(GeometryDecoder.Context.Peek.Category?.Id ?? element.Category.Id)) return true;
return false;
}
).
Where(x => !x.IsNullOrEmpty())
);
Expand Down

0 comments on commit 7af5249

Please sign in to comment.