Revit二次开发:创建FamilyInstance无法获取面
2020-02-24 本文已影响0人
BIMnotes
![](https://img.haomeiwen.com/i15587633/b13e320522d0f8dc.png)
- 使用NewFamilyInstance带有face的重载,必须用Element.Geometry 获取,并打开ComputeReferences选项
Face face = null;
Options geomOptions = new Options();
geomOptions.ComputeReferences = true;
GeometryElement wallGeom = wall.get_Geometry(geomOptions);
foreach (GeometryObject geomObj in wallGeom)
{
Solid geomSolid = geomObj as Solid;
if (null != geomSolid)
{
foreach (Face geomFace in geomSolid.Faces)
{
face = geomFace;
break;
}
break;
}
}
- 连续的墙体,对于共面的墙无法获取reference。取消墙连接即可。
WallUtils.DisallowWallJoinAtEnd(wall, 0);