Select elements that are cut in active view

I need assistance in selecting all elements within the current view that are cut, irrespective of the view type (e.g., floorplan, section, elevation, 3D, etc.). I want the selection to be independent of whether the view has an active crop region or not.

Obviously Revit already assigns hatches to elements based on whether they are cut or not, so I believe there should be a straightforward solution to identify and select these elements programmatically.

Any ideas on how to approach this?

A solution using only nodes:

  1. Get the view
  2. Pull the view’s plane
  3. Pull the elements in the view and filter out any elements in an annotation or non-model categories.
  4. Pull the geometry of the elements
  5. Use a Geometry.DoesIntersect node to check if the element geometry intersects the plane.
  6. Use a Filter.ByBoolMask node to remove the the elements (step 3) which returned true in the boolean list (step 5). The ‘in’ list will be items cut by the plane, even if the cut is outside the limits of the clipping range.
1 Like

Thank you.
Doesn´t work in 3D but I can live with that.

It should; likely your 3D view is actually a section box though. Instead of a plane in such cases you’ll want to query the section box for the view and use that instead. :slight_smile: