简体   繁体   中英

Get the floor and ceiling of a room

How can I get the current floor and the current ceiling of a room with the Revit API? I`m using the 2012 version.

I`ve tried:

 segments = el.GetBoundarySegments(new SpatialElementBoundaryOptions());

and:

var cs = el.ClosedShell;

and even this:

SpatialElementGeometryCalculator calculator = 
  new SpatialElementGeometryCalculator(doc);

SpatialElementGeometryResults results = 
  calculator.CalculateSpatialElementGeometry(el);

Solid roomSolid = results.GetGeometry(); 

foreach (Face face in roomSolid.Faces)  
{
    // Subface Code
}

I think there is no simple way to do this. You need to loop on faces, like in your third sample and compare the normal direction against Z vector (with XYZ.IsAlmostEqualTo ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM