|
@@ -4,9 +4,11 @@
|
|
|
* 创建日期:2019/12/6 14:52:05
|
|
|
* ==============================================================================*/
|
|
|
|
|
|
+using Autodesk.Revit.DB;
|
|
|
using Autodesk.Revit.DB.Mechanical;
|
|
|
using RevitToJBim.MBI;
|
|
|
using SAGA.DotNetUtils.Extend;
|
|
|
+using SAGA.RevitUtils.Extends;
|
|
|
|
|
|
namespace RevitToJBim.Extension
|
|
|
{
|
|
@@ -29,5 +31,21 @@ namespace RevitToJBim.Extension
|
|
|
//空间比较特殊,周长为零就相当于删除
|
|
|
return (perimeter.IsZero(MBIConst.SpacePerimeterTolerance)) || (area.IsZero(MBIConst.SpaceAreaTolerance));
|
|
|
}
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 获取空间的默认名称
|
|
|
+ /// 如果空间名称为“空间”或者为“”则显示Name
|
|
|
+ /// 否则显示Room_Name
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="space"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static string GetSpaceDefaultName(this Space space)
|
|
|
+ {
|
|
|
+ string defaultName = space.Name;
|
|
|
+ var roomname = space.GetParameterString(BuiltInParameter.ROOM_NAME);
|
|
|
+ if (roomname == "空间" || roomname.IsNullOrEmptyExt()) return defaultName;
|
|
|
+ defaultName = roomname;
|
|
|
+ return defaultName;
|
|
|
+ }
|
|
|
}
|
|
|
}
|