[英]How to pull the starting view for document using the Revit API
I used the Revit Lookup tool and browsed through the database to find a class called StartingViewSettings
with the property ViewId
that will get me the ElementId
of the starting view. 我使用Revit查找工具,并在数据库中浏览,找到了一个名为
StartingViewSettings
的类,该类具有属性ViewId
,该类将使我获得起始视图的ElementId
。 My actual code for getting the view is below 我获取视图的实际代码如下
FilteredElementCollector startingViewSettingsCollector =
new FilteredElementCollector(document);
startingViewSettingsCollector.OfClass(typeof(StartingViewSettings));
View startingView = null;
foreach(StartingViewSettings settings in startingViewSettingsCollector)
{
startingView = (View)document.GetElement(settings.ViewId);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.