[英]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? 如何使用Revit API获取房间的当前楼层和当前天花板? I`m using the 2012 version.
我正在使用2012版本。
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
). 您需要像在第三个样本中那样在面部上循环,然后将法线方向与Z向量进行比较(使用
XYZ.IsAlmostEqualTo
)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.