【问题标题】:How to pull the starting view for document using the Revit API如何使用 Revit API 拉取文档的起始视图
【发布时间】:2017-08-16 00:03:37
【问题描述】:

如何使用 Revit API 获取 Document 的起始视图?使用用户界面访问它的等效方法如下所示:

【问题讨论】:

    标签: c# revit-api revit


    【解决方案1】:

    我使用Revit Lookup tool 并浏览数据库以找到一个名为StartingViewSettings 的类,该类具有ViewId 属性,它将为我提供起始视图的ElementId。我获取视图的实际代码如下

    FilteredElementCollector startingViewSettingsCollector = 
      new FilteredElementCollector(document);
    startingViewSettingsCollector.OfClass(typeof(StartingViewSettings));
    
    View startingView = null;
    
    foreach(StartingViewSettings settings in startingViewSettingsCollector)
    {
        startingView = (View)document.GetElement(settings.ViewId);
    }
    

    【讨论】:

      猜你喜欢
      • 2014-09-18
      • 2013-01-07
      • 2017-01-14
      • 2016-04-19
      • 2016-12-28
      • 2019-11-06
      • 2019-03-29
      • 2020-10-07
      • 2014-03-23
      相关资源
      最近更新 更多