|
@@ -201,11 +201,6 @@ namespace SAGA.MBI.Tools
|
|
|
//移除前面和后面的空格
|
|
|
code = code.Trim();
|
|
|
}
|
|
|
- else if (element is Wall wall)
|
|
|
- {
|
|
|
- if (wall.IsCurtaiWall())
|
|
|
- code = MBIConst.CurtainWallCode;
|
|
|
- }
|
|
|
|
|
|
return code;
|
|
|
}
|
|
@@ -255,5 +250,19 @@ namespace SAGA.MBI.Tools
|
|
|
|
|
|
return space;
|
|
|
}
|
|
|
+ /// <summary>
|
|
|
+ /// 获取部件所关联的设备
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="element"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static Element GetEquipPartParent(this Element element)
|
|
|
+ {
|
|
|
+ string code = element?.GetFamily().Name.Substring(0, 4); ;
|
|
|
+ if (code.IsNullOrEmpty()) return null;
|
|
|
+ //构件所关联的设备
|
|
|
+ var parentInst = element.Document.GetElements(new ElementIntersectsElementFilter(element))
|
|
|
+ .FirstOrDefault(t => !t.Id.IsEqual(element.Id) && t.GetFamilyCode() == code);
|
|
|
+ return parentInst;
|
|
|
+ }
|
|
|
}
|
|
|
}
|