|
@@ -20,6 +20,7 @@ using SAGA.DotNetUtils;
|
|
|
using Parameter = JBIM.Component.Parameter;
|
|
|
using SAGA.RevitUtils;
|
|
|
using SAGA.DotNetUtils.Extend;
|
|
|
+using System.Configuration;
|
|
|
|
|
|
namespace RevitToJBim.Common
|
|
|
{
|
|
@@ -100,13 +101,14 @@ namespace RevitToJBim.Common
|
|
|
}
|
|
|
if (hasEquipComponentCode)
|
|
|
{
|
|
|
+ var equipComponentCode = ConfigurationManager.AppSettings["EquipComponentCode"];
|
|
|
var typeParameter = ele?.GetElementType()?.Parameters;
|
|
|
foreach (Autodesk.Revit.DB.Parameter p in typeParameter)
|
|
|
{
|
|
|
- if (MBIBuiltInParameterName.EquipComponentCode.Equals(p.Definition.Name))
|
|
|
+ if (equipComponentCode.Equals(p.Definition.Name))
|
|
|
{
|
|
|
if (!p.HasValue || (p.AsString() == null && p.AsString().Length == 0)) continue;
|
|
|
- var parameter = new Parameter(ParameterUtil.FindParameterDefine(MBIBuiltInParameterName.EquipComponentCode));
|
|
|
+ var parameter = new Parameter(ParameterUtil.FindParameterDefine(equipComponentCode));
|
|
|
parameter.Value = p.AsString();
|
|
|
parameters.Add(parameter);
|
|
|
}
|
|
@@ -122,7 +124,7 @@ namespace RevitToJBim.Common
|
|
|
/// <returns></returns>
|
|
|
public static List<Parameter> GetFacilityParameters(FamilyInstance fi)
|
|
|
{
|
|
|
- List<string> parameterNames = new List<string>() { MBIBuiltInParameterName.EquipLocalName, MBIBuiltInParameterName.EquipLocalID, MBIBuiltInParameterName.PropertyID };
|
|
|
+ List<string> parameterNames = ConfigurationManager.AppSettings["FacilityParameters"].Split(',').ToList();
|
|
|
List<Parameter> parameters = GetParameters(fi, parameterNames, true);
|
|
|
return parameters;
|
|
|
}
|
|
@@ -133,18 +135,29 @@ namespace RevitToJBim.Common
|
|
|
/// <returns></returns>
|
|
|
public static List<Parameter> GetSpaceParameters(Element space)
|
|
|
{
|
|
|
- List<string> parameterNames = new List<string>() { MBIBuiltInParameterName.SpaceName, MBIBuiltInParameterName.SpaceNumber, MBIBuiltInParameterName.SpaceStandardTypeCode, MBIBuiltInParameterName.SpaceStandardType };
|
|
|
+ List<string> parameterNames = ConfigurationManager.AppSettings["SpaceParameters"].Split(',').ToList();
|
|
|
List<Parameter> parameters = GetParameters(space, parameterNames, false);
|
|
|
return parameters;
|
|
|
}
|
|
|
/// <summary>
|
|
|
+ /// 获取房间的参数
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="room"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public static List<Parameter> GetRoomParameters(Element room)
|
|
|
+ {
|
|
|
+ List<string> parameterNames = ConfigurationManager.AppSettings["RoomParameters"].Split(',').ToList();
|
|
|
+ List<Parameter> parameters = GetParameters(room, parameterNames, false);
|
|
|
+ return parameters;
|
|
|
+ }
|
|
|
+ /// <summary>
|
|
|
/// 获取设备设施的参数
|
|
|
/// </summary>
|
|
|
/// <param name="space"></param>
|
|
|
/// <returns></returns>
|
|
|
public static List<Parameter> GetMEPCurveParameters(MEPCurve curve)
|
|
|
{
|
|
|
- List<string> parameterNames = new List<string>() { MBIBuiltInParameterName.MEPCurveComments };
|
|
|
+ List<string> parameterNames = ConfigurationManager.AppSettings["MEPCurveParameters"].Split(',').ToList();
|
|
|
List<Parameter> parameters = GetParameters(curve, parameterNames, false);
|
|
|
return parameters;
|
|
|
}
|