|
@@ -96,10 +96,35 @@ namespace RevitToJBim.Common
|
|
|
parameters.Add(parameter);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ var typeParameter = fi?.GetElementType()?.Parameters;
|
|
|
+ foreach (Autodesk.Revit.DB.Parameter p in typeParameter)
|
|
|
+ {
|
|
|
+ if (MBIBuiltInParameterName.EquipComponentCode.Equals(p.Definition.Name))
|
|
|
+ {
|
|
|
+ if(!p.HasValue || (p.AsString() == null && p.AsString().Length == 0))
|
|
|
+ continue;
|
|
|
+ var parameter =
|
|
|
+ new Parameter(ParameterUtil.FindParameterDefine(MBIBuiltInParameterName.EquipComponentCode));
|
|
|
+ parameter.Value = p.AsString();
|
|
|
+ parameters.Add(parameter);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
return parameters;
|
|
|
}
|
|
|
|
|
|
+ public static ElementType GetElementType(Element element)
|
|
|
+ {
|
|
|
+ ElementId id = element.GetTypeId();
|
|
|
+ if (id != null && id != ElementId.InvalidElementId)
|
|
|
+ {
|
|
|
+ Element elementType = element.Document.GetElement(id);
|
|
|
+ return elementType as ElementType;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 获取设备设施的参数
|
|
|
/// </summary>
|
|
@@ -107,7 +132,7 @@ namespace RevitToJBim.Common
|
|
|
/// <returns></returns>
|
|
|
public static List<Parameter> GetSpaceParameters(Space space)
|
|
|
{
|
|
|
- List<string> parameterNames = new List<string>() { MBIBuiltInParameterName.SpaceName, MBIBuiltInParameterName.SpaceNumber };
|
|
|
+ List<string> parameterNames = new List<string>() { MBIBuiltInParameterName.SpaceName, MBIBuiltInParameterName.SpaceNumber, MBIBuiltInParameterName.SpaceStandardTypeCode, MBIBuiltInParameterName.SpaceStandardType };
|
|
|
List<Parameter> parameters = new List<Parameter>();
|
|
|
foreach (var parameterName in parameterNames)
|
|
|
{
|