美文网首页BIMnotes
Revit二次开发:创建FamilyInstance无法获取面

Revit二次开发:创建FamilyInstance无法获取面

作者: BIMnotes | 来源:发表于2020-02-24 13:10 被阅读0次
make sure to turn on the option
  1. 使用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;
    }
}

  1. 连续的墙体,对于共面的墙无法获取reference。取消墙连接即可。
WallUtils.DisallowWallJoinAtEnd(wall, 0);

相关文章

网友评论

    本文标题:Revit二次开发:创建FamilyInstance无法获取面

    本文链接:https://www.haomeiwen.com/subject/nmamqhtx.html