| | |
| | | using Autodesk.Revit.DB; |
| | | using Autodesk.Revit.DB.Plumbing; |
| | | using Glodon.Revit.Utility; |
| | | using HStation.RevitDev.RevitDataExport.Common; |
| | | using HStation.RevitDev.RevitDataExport.Utility; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | |
| | | namespace HStation.RevitDev.RevitDataExport.Parser |
| | | { |
| | | /// <summary> |
| | | /// 水箱 |
| | | /// </summary> |
| | | public class ShuiXiangParser : BaseParser |
| | | { |
| | | public override List<BuiltInCategory> FilterCategories |
| | | { |
| | | get |
| | | { |
| | | return new List<BuiltInCategory> |
| | | { |
| | | BuiltInCategory.OST_PipeAccessory, |
| | | BuiltInCategory.OST_MechanicalEquipment, |
| | | BuiltInCategory.OST_PipeFitting, |
| | | 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 initlevel = ParameterOperator.GetParameterValueAsDouble(elem, "水位"); //(pipe.Location as LocationCurve).Curve.Length.FeetToMM(); |
| | | if (initlevel.HasValue) |
| | | { |
| | | result.Add(new Tuple<string, string>($"水位", initlevel.Value.ToString("f2"))); |
| | | } |
| | | var minlevel = ParameterOperator.GetParameterValueAsDouble(elem, "最低水位"); //(pipe.Location as LocationCurve).Curve.Length.FeetToMM(); |
| | | if (minlevel.HasValue) |
| | | { |
| | | result.Add(new Tuple<string, string>($"最低水位", minlevel.Value.ToString("f2"))); |
| | | } |
| | | var maxlevel = ParameterOperator.GetParameterValueAsDouble(elem, "最高水位"); //(pipe.Location as LocationCurve).Curve.Length.FeetToMM(); |
| | | if (maxlevel.HasValue) |
| | | { |
| | | result.Add(new Tuple<string, string>($"最高水位", maxlevel.Value.ToString("f2"))); |
| | | } |
| | | return result; |
| | | } |
| | | } |
| | | } |
| | | using Autodesk.Revit.DB;
|
| | | using Autodesk.Revit.DB.Plumbing;
|
| | | 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_WaterBox)]
|
| | | public class ShuiXiangParser : BaseParser
|
| | | {
|
| | | public override List<BuiltInCategory> FilterCategories
|
| | | {
|
| | | get
|
| | | {
|
| | | return new List<BuiltInCategory>
|
| | | {
|
| | | BuiltInCategory.OST_PipeAccessory,
|
| | | BuiltInCategory.OST_MechanicalEquipment,
|
| | | BuiltInCategory.OST_PipeFitting,
|
| | | BuiltInCategory.OST_GenericModel
|
| | | };
|
| | | }
|
| | | }
|
| | | public override List<string> FilterRegexes
|
| | | {
|
| | | get
|
| | | {
|
| | | return new List<string>
|
| | | {
|
| | | "水箱"
|
| | | };
|
| | | }
|
| | | }
|
| | |
|
| | | public override string GetParserName()
|
| | | {
|
| | | return "水箱";
|
| | | }
|
| | |
|
| | | public override ElementModel Parse(Element elem)
|
| | | {
|
| | | var elemModel = BaseParse(elem);
|
| | | var result = new WaterBoxModel(elemModel);
|
| | | result.Id = elemModel.Id;
|
| | | result.LinkIds = ElementExtense2.GetLinkedElementIds(result.Id);
|
| | |
|
| | | var waterLevel = ParameterOperator.GetParameterValueAsString(elem, "水位");
|
| | | var bottomLevel = ParameterOperator.GetParameterValueAsString(elem, "最低水位");
|
| | | var topLevel = ParameterOperator.GetParameterValueAsString(elem, "最高水位");
|
| | | result.WaterLevel = waterLevel;
|
| | | result.BottomLevel = bottomLevel;
|
| | | result.TopLevel = topLevel;
|
| | | return result;
|
| | | }
|
| | |
|
| | | 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 initlevel = ParameterOperator.GetParameterValueAsDouble(elem, "水位"); //(pipe.Location as LocationCurve).Curve.Length.FeetToMM();
|
| | | if (initlevel.HasValue)
|
| | | {
|
| | | result.Add(new Tuple<string, string>($"水位", initlevel.Value.ToString("f2")));
|
| | | }
|
| | | var minlevel = ParameterOperator.GetParameterValueAsDouble(elem, "最低水位"); //(pipe.Location as LocationCurve).Curve.Length.FeetToMM();
|
| | | if (minlevel.HasValue)
|
| | | {
|
| | | result.Add(new Tuple<string, string>($"最低水位", minlevel.Value.ToString("f2")));
|
| | | }
|
| | | var maxlevel = ParameterOperator.GetParameterValueAsDouble(elem, "最高水位"); //(pipe.Location as LocationCurve).Curve.Length.FeetToMM();
|
| | | if (maxlevel.HasValue)
|
| | | {
|
| | | result.Add(new Tuple<string, string>($"最高水位", maxlevel.Value.ToString("f2")));
|
| | | }
|
| | | return result;
|
| | | }
|
| | | }
|
| | | }
|