//获取楼层平面视图
var aView = views.ToList().Find(s => (s as Autodesk.Revit.DB.View).ViewType == ViewType.FloorPlan) as Autodesk.Revit.DB.View;
uiDoc.ActiveView = aView;
//获取所有已打开视图
IList<UIView> uIViews = uiDoc.GetOpenUIViews();
foreach (UIView uIView in uIViews)
{
if (doc.GetElement(uIView.ViewId).Id != aView.Id)
{
uIView.Close();
}
else
{
uIView.ZoomToFit();
}
}
//获取当前激活视图的所有图元
List<Element> allGroupList = new FilteredElementCollector(doc, aView.Id).OfClass(typeof(Group)).ToList();
第一步 过滤出来所有平面视图
获取已经打开的视图
获取当前激活视图的所有图元