Filtering via BoundarySegments/CurveLoop?

Filtering via BoundarySegments/CurveLoop?

grubdex
Enthusiast Enthusiast
401 Views
3 Replies
Message 1 of 4

Filtering via BoundarySegments/CurveLoop?

grubdex
Enthusiast
Enthusiast

I'm trying to figure out if there is an easy way to filter elements by BoundarySegments or CurveLoops?

The BoundingBox filters are helpful, but often too coarse, since rectangle shapes that also happen to be parallel to the X&Y axes (instead of e.g. diagonal) are not that common - think L-shaped room. I've looked at https://thebuildingcoder.typepad.com/blog/2015/12/quick-slow-and-linq-element-filtering.html for potential filters but couldn't find one that matches this need.

0 Likes
Accepted solutions (1)
402 Views
3 Replies
Replies (3)
Message 2 of 4

jeremy_tammik
Alumni
Alumni

The Revit BIM and the intersection filters provided for extracting elements from it are 3D.

  

BoundarySegment or CurveLoop is 2D.

  

I am not aware of any built-in pure 2D filtered element collectors.

  

So, I think you will need to put on your thinking cap and ponder a custom approach to this task.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 4

RPTHOMAS108
Mentor
Mentor
Accepted solution

If the curve loops are closed and non-intersecting, then you can extrude a thin solid to use with ElementIntersectsSolidFilter (GeometryCreationUtilities.CreateExtrusionGeometry)

 

When you use ElementIntersectsSolidFilter/ElementIntersectsElementFilter you to have to consider that it doesn't apply to all categories.

Message 4 of 4

grubdex
Enthusiast
Enthusiast

Thanks for your response. Could you by chance explain this approach a bit more? My questions are:

1. Does this create a full solid within the region enclosed by the curveloops or is this just a thick "boundary" so to speak? Because I'd want to filter fo everything within the boundaries, which would only be doable with the first interpretation.

2. How would one choose the extrusionDir exactly? AFAIK, the curves within a Curveloop can go in totally different directions in 3D space, and the same definitely holds for a List of Curveloops. How does choosing a single extrusion direction make sense here?

 

A sample code might clear things up a bit more - if you have one at hand it would be much appreciated 🙂

 

Thanks and happy new year!