1

I'm a MEP engineer and I want to add space information on mechanical equipment, duct accessories and pipe accessories above the (room bounding) ceilings.

My first idea was to use BoundingBoxIntersectsFilter with an Outline with a modified ClosedShell.GetBoundingBox().Max.Z from the space and then use a BoundingBoxIntersectsFilter to catch my elements. This method works, but I will have trouble with accuracy above spaces which are note limited to six sides. This is because of the fact than Outline only takes to points. Now, I'm thinking I need to convert my spaces to a solid geometry and modify the Z-value and then use the ElementIntersectsElementFilter, but I am currently stuck figuring out which methods to use to modify my space geometry.

Maybe I need to use the GetGeometryObjectFromReference, but I do not really understand how to use Reference. I've seen get_Geometry has been used here, but I need help how to use it. Specifically, this is the code I do not understand how to implement in python code:

foreach( GeometryObject obj in e.Objects )
  {
    Solid solid = obj as Solid;
    if( null != solid )
    {
      foreach( Face face in solid.Faces )
      {
        PlanarFace pf = face as PlanarFace;
        if( null != pf )

Any kick in the right direction is much appreciated!

Kyrre

Kyrre
  • 85
  • 1
  • 5
  • You might want to use ReferenceIntersector. Here is an exemple, replace floor/roof by space : https://github.com/CyrilWaechter/pyRevitMEP/blob/master/pyRevitMEP.tab/Data.panel/ElevationUnder.pushbutton/script.py – Cyril Waechter May 12 '19 at 12:35

2 Answers2

2

When I've done this before, sometimes I've used an easier approach. Identify the key point on the equipment, then drop down the z-value on that equipment point to a z-value just above the next Level down that has spaces on it, and then test that XYZ to determine which space encloses it.

Matt
  • 1,043
  • 5
  • 8
1

There are many ways to do this. I think the simplest might be to simply do this in two steps. First, use a bounding box or an outline or whatever quick filter fits your needs to reduce the number of potential candidate objects to a reasonable number within a rectangular area. In a second step, iterate through the candidate objects one by one an call the Space. IsPointInSpace method on each of them to eliminate the ones lying outside an irregular space boundary.

Jeremy Tammik
  • 7,333
  • 2
  • 12
  • 17