/// <summary>
/// 取得墙侧面
/// </summary>
/// <param name="wall"></param>
/// <returns></returns>
public List<Face> GetWallFaces(Wall wall)
{
List<Face> faces = new List<Face>();
Options options = new Options();
//打开computeReferences选项
options.ComputeReferences = true;
GeometryElement geoEle = wall.get_Geometry(options);
foreach (GeometryObject geometryObject in geoEle)
{
if (geometryObject == null || (geometryObject as Solid).Faces.Size <= 1)
continue;
foreach (Face face in (geometryObject as Solid).Faces)
{
XYZ normal = (face as PlanarFace).FaceNormal;
//比较向量夹角获取墙侧角,wall.orientation为墙的正方向
if (normal.AngleTo(wall.Orientation) < 0.01 || normal.AngleTo(-wall.Orientation) < 0.01)
{
faces.Add(face);
}
}
}
return faces;
}
获取墙侧面
最新推荐文章于 2025-07-30 11:42:32 发布