| | |
| | | using Autodesk.Revit.DB; |
| | | using Glodon.Revit.Utility; |
| | | using HStation.RevitDev.Model.AttributeClass; |
| | | using HStation.RevitDev.RevitDataExport.Common; |
| | | using HStation.RevitDev.RevitDataExport.Utility; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | |
| | | namespace HStation.RevitDev.RevitDataExport.Parser |
| | | { |
| | | /// <summary> |
| | | /// 阀门 |
| | | /// </summary> |
| | | [RevitType(Model.ModelEnum.RevitType.RFT_Valve)] |
| | | public class FaMenParser : BaseParser |
| | | { |
| | | public override List<BuiltInCategory> FilterCategories |
| | | { |
| | | get |
| | | { |
| | | return new List<BuiltInCategory> |
| | | { |
| | | BuiltInCategory.OST_MechanicalEquipment, |
| | | BuiltInCategory.OST_PipeFitting, |
| | | BuiltInCategory.OST_PipeAccessory, |
| | | BuiltInCategory.OST_GenericModel |
| | | }; |
| | | } |
| | | } |
| | | public override List<string> FilterRegexes |
| | | { |
| | | get |
| | | { |
| | | return new List<string> |
| | | { |
| | | "阀|防止器|试水装置|气候补偿|供热量控制|末端试水" |
| | | }; |
| | | } |
| | | } |
| | | |
| | | public override string GetParserName() |
| | | { |
| | | return "阀门"; |
| | | } |
| | | |
| | | public override List<Tuple<string, string>> PropertyParse(Element elem) |
| | | { |
| | | var result = new List<Tuple<string, string>>(); |
| | | var fi = elem as FamilyInstance; |
| | | if (fi == null) { return result; } |
| | | var connectInfos = MEPHelper.GetConnecters(fi); |
| | | result.AddRange(CommonPropertyParse(elem)); |
| | | for (int i = 1; i <= 5; i++) |
| | | { |
| | | if (connectInfos.Count >= i) |
| | | { |
| | | result.Add(new Tuple<string, string>($"连接点{i}", connectInfos[i - 1]?.ElementId.ToString())); |
| | | } |
| | | else |
| | | { |
| | | result.Add(new Tuple<string, string>($"连接点{i}", string.Empty)); |
| | | } |
| | | } |
| | | |
| | | // 公称压力 |
| | | var length = (fi.Location as LocationCurve)?.Curve?.Length.FeetToMM(); |
| | | result.Add(new Tuple<string, string>($"公称压力", ParameterOperator.GetParameterValueAsDouble(fi, "公称压力", ParameterConvert.InnerToMPa).ToString())); |
| | | |
| | | //公称直径 |
| | | var diameter = ParameterOperator.GetParameterValueAsString(elem, "公称直径"); |
| | | result.Add(new Tuple<string, string>($"直径", diameter == null ? "0" : diameter.Replace("mm", "").Trim())); |
| | | return result; |
| | | } |
| | | } |
| | | } |
| | | using Autodesk.Revit.DB;
|
| | | using Glodon.Revit.Utility;
|
| | | using HStation.RevitDev.Model.AttributeClass;
|
| | | using HStation.RevitDev.RevitDataExport.Common;
|
| | | using HStation.RevitDev.RevitDataExport.Entity;
|
| | | using HStation.RevitDev.RevitDataExport.Entity.ElementModels;
|
| | | using HStation.RevitDev.RevitDataExport.Utility;
|
| | | using System;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | namespace HStation.RevitDev.RevitDataExport.Parser
|
| | | {
|
| | | /// <summary>
|
| | | /// 阀门
|
| | | /// </summary>
|
| | | [RevitType(Model.ModelEnum.RevitType.RFT_Valve)]
|
| | | public class FaMenParser : BaseParser
|
| | | {
|
| | | public override List<BuiltInCategory> FilterCategories
|
| | | {
|
| | | get
|
| | | {
|
| | | return new List<BuiltInCategory>
|
| | | {
|
| | | BuiltInCategory.OST_MechanicalEquipment,
|
| | | BuiltInCategory.OST_PipeFitting,
|
| | | BuiltInCategory.OST_PipeAccessory,
|
| | | BuiltInCategory.OST_GenericModel
|
| | | };
|
| | | }
|
| | | }
|
| | | public override List<string> FilterRegexes
|
| | | {
|
| | | get
|
| | | {
|
| | | return new List<string>
|
| | | {
|
| | | "阀|防止器|试水装置|气候补偿|供热量控制|末端试水"
|
| | | };
|
| | | }
|
| | | }
|
| | |
|
| | | public override string GetParserName()
|
| | | {
|
| | | return "阀门";
|
| | | }
|
| | |
|
| | | public override List<Tuple<string, string>> PropertyParse(Element elem)
|
| | | {
|
| | | var result = new List<Tuple<string, string>>();
|
| | | var fi = elem as FamilyInstance;
|
| | | if (fi == null) { return result; }
|
| | | var connectInfos = MEPHelper.GetConnecters(fi);
|
| | | result.AddRange(CommonPropertyParse(elem));
|
| | | for (int i = 1; i <= 5; i++)
|
| | | {
|
| | | if (connectInfos.Count >= i)
|
| | | {
|
| | | result.Add(new Tuple<string, string>($"连接点{i}", connectInfos[i - 1]?.ElementId.ToString()));
|
| | | }
|
| | | else
|
| | | {
|
| | | result.Add(new Tuple<string, string>($"连接点{i}", string.Empty));
|
| | | }
|
| | | }
|
| | |
|
| | | // 公称压力
|
| | | var length = (fi.Location as LocationCurve)?.Curve?.Length.FeetToMM();
|
| | | result.Add(new Tuple<string, string>($"公称压力", ParameterOperator.GetParameterValueAsDouble(fi, "公称压力", ParameterConvert.InnerToMPa).ToString()));
|
| | |
|
| | | //公称直径
|
| | | var diameter = ParameterOperator.GetParameterValueAsString(elem, "公称直径");
|
| | | result.Add(new Tuple<string, string>($"直径", diameter == null ? "0" : diameter.Replace("mm", "").Trim()));
|
| | | return result;
|
| | | }
|
| | |
|
| | | public override ElementModel Parse(Element elem)
|
| | | {
|
| | | var elemModel = BaseParse(elem);
|
| | | var result = new ValveModel(elemModel);
|
| | | result.编号 = elemModel.编号;
|
| | | result.连接构件 = ElementExtense2.GetLinkedElementIds(result.编号);
|
| | | var pressure = ParameterOperator.GetParameterValueAsDouble(elem, "公称压力", ParameterConvert.InnerToMPa).ToString();
|
| | | var diameter = ParameterOperator.GetParameterValueAsDouble(elem, "公称直径", StaticUtils.InnerToMM).ToString();
|
| | | result.公称压力 = pressure;
|
| | | result.公称直径 = diameter;
|
| | | return result;
|
| | | }
|
| | | }
|
| | | }
|