在Revit api中创建门的详细视图

时间:2017-08-16 08:20:07

标签: revit-api revit

如何使用Revit API(外部命令)在特定门的Revit中创建详细视图?现在我设法创建了DetailView,但是当我在Revit中打开时,它看起来并不是我的预期(参见图片:expectedwhat I get)。

以下是代码:

IEnumerable<ViewFamilyType> viewFamilyTypes = from elem in new FilteredElementCollector(doc).OfClass(typeof(ViewFamilyType))
                                                      let type = elem as ViewFamilyType
                                                      where type.ViewFamily == ViewFamily.Detail
                                                      select type;
        //uiDoc.Selection.SetElementIds(new List<ElementId>() { door.Id });
        var dim = door.get_BoundingBox(null);

        using (Transaction transaction = new Transaction(doc))
        {
            transaction.Start("Creating Detail View");
            BoundingBoxXYZ box = dim;
            var detailView = ViewSection.CreateDetail(doc,viewFamilyTypes.First().Id, box);

            detailView.Discipline = ViewDiscipline.Architectural;
            detailView.DetailLevel = ViewDetailLevel.Coarse;
            transaction.Commit();
        }

我正在使用Revit 2018, 欢迎任何帮助或建议,以完成我的学生研究。

1 个答案:

答案 0 :(得分:1)

关于creating a section view的建筑编码器文章有帮助吗?