Wall.Orientation指示墙的正方向,判断Face与这个正方向的夹角一致,即为墙的正面。
//找到墙的正面
public static Face FindWallFace(Wall wall)
{
    Face normalFace = null;
    //
    Options opt = new Options();
    opt.ComputeReferences = true;
    opt.DetailLevel = Autodesk.Revit.DB.DetailLevels.Medium;
    //
    GeometryElement e = wall.get_Geometry(opt);
    foreach (GeometryObject obj in e.Objects)
    {
        Solid solid = obj as Solid;
        if (solid != null && solid.Faces.Size > 0)
        {
            foreach (Face face in solid.Faces)
            {
                PlanarFace pf = face as PlanarFace;
                if (pf != null)
                {
                    if (pf.Normal.AngleTo(wall.Orientation) < 0.01)//数值在0到PI之间
                    {
                        normalFace = face;
                    }
                }
            }
        }
    }
    return normalFace;
}
from:http://revit.5d6d.com/thread-1374-1-1.html

相关文章:

  • 2022-12-23
  • 2022-02-05
  • 2021-04-21
  • 2022-12-23
  • 2021-12-27
  • 2021-07-04
  • 2022-02-12
  • 2021-10-23
猜你喜欢
  • 2022-12-23
  • 2021-07-24
  • 2022-12-23
  • 2022-03-08
  • 2021-11-24
  • 2021-05-24
  • 2021-07-20
相关资源
相似解决方案