|
@@ -7,6 +7,8 @@
|
|
|
|
|
|
using Autodesk.Revit.DB;
|
|
|
using Autodesk.Revit.DB.Mechanical;
|
|
|
+using SAGA.MBI.Tools;
|
|
|
+using SAGA.RevitUtils;
|
|
|
using SAGA.RevitUtils.Extends;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
@@ -121,7 +123,10 @@ namespace SAGA.MBI.Common
|
|
|
{
|
|
|
return new List<Space>();
|
|
|
}
|
|
|
- return sourceSpaces.Where(s => s.GetCurrentPhaseId() == useId && s.Area > 0.001).ToList();
|
|
|
+
|
|
|
+ return
|
|
|
+ sourceSpaces.Where(s => s.IsSpace())
|
|
|
+ .ToList(); // sourceSpaces.Where(s => s.GetCurrentPhaseId() == useId && s.Area > 0.001).ToList();
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 判断是否是阶段1的空间
|
|
@@ -134,5 +139,20 @@ namespace SAGA.MBI.Common
|
|
|
var useId = GetUsePhaseId(doc);
|
|
|
return space.GetCurrentPhaseId() == useId;
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 空间标高是否是当前使用视图标高
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="space"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static bool IsViewLevel(this Space space)
|
|
|
+ {
|
|
|
+ var doc = space.Document;
|
|
|
+ var useViewId = doc.GetUseView();
|
|
|
+ if (useViewId == null)
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return space.Level?.Id== useViewId.GenLevel?.Id;
|
|
|
+ }
|
|
|
}
|
|
|
}
|