| | |
| | | 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 System;
|
| | | using HStation.RevitDev.RevitDataExport.Utility;
|
| | | using System.Collections.Generic;
|
| | |
|
| | | namespace HStation.RevitDev.RevitDataExport.Parser
|
| | | {
|
| | | /// <summary>
|
| | | /// 弯头
|
| | | /// qita |
| | | /// </summary>
|
| | | ///
|
| | | [RevitType(Model.ModelEnum.RevitType.RFT_Others)]
|
| | | public class QitaParser : BaseParser
|
| | | public class QitaParser/* : BaseParser*/
|
| | | {
|
| | | public override List<BuiltInCategory> FilterCategories
|
| | | {
|
| | | get |
| | | {
|
| | | return new List<BuiltInCategory> |
| | | {
|
| | | |
| | | };
|
| | | }
|
| | | }
|
| | | public override List<string> FilterRegexes
|
| | | {
|
| | | get |
| | | {
|
| | | return new List<string> |
| | | {
|
| | | |
| | | };
|
| | | } |
| | | }
|
| | | //public override List<BuiltInCategory> FilterCategories
|
| | | //{
|
| | | // get
|
| | | // {
|
| | | // return new List<BuiltInCategory>
|
| | | // {
|
| | |
|
| | | public override string GetParserName()
|
| | | {
|
| | | return "其他";
|
| | | }
|
| | | // };
|
| | | // }
|
| | | //}
|
| | | //public override List<string> FilterRegexes
|
| | | //{
|
| | | // get
|
| | | // {
|
| | | // return new List<string>
|
| | | // {
|
| | |
|
| | | public override ElementModel Parse(Element elem)
|
| | | // };
|
| | | // }
|
| | | //}
|
| | |
|
| | | //public override string GetParserName()
|
| | | //{
|
| | | // return "其他";
|
| | | //}
|
| | |
|
| | | public /*override*/ ElementModel Parse(Element elem)
|
| | | {
|
| | | var elemModel = BaseParse(elem);
|
| | | var result = new OtherModel(elemModel);
|
| | | return result;
|
| | | }
|
| | |
|
| | | public override List<Tuple<string, string>> PropertyParse(Element elem)
|
| | | public OtherModel BaseParse(Element elem)
|
| | | {
|
| | | var result = new List<Tuple<string, string>>();
|
| | | var instance = elem.Document.GetElement(elem.Id);
|
| | | var fi = instance as FamilyInstance;
|
| | | if (fi == null) { return result; }
|
| | | var connectInfos = MEPHelper.GetConnecters(fi);
|
| | | result.AddRange(CommonPropertyParse(elem));
|
| | | for (int i = 1; i <= 5; i++)
|
| | | var elemName = ParameterOperator.GetElementName(elem);
|
| | | var elemId = elem.Id.IntegerValue.ToString();
|
| | | var sysName = ParameterOperator.GetElementPipingSystemType(elem)?.Name;
|
| | | var box = BoundingBoxHelper.BoundingBoxSerialize(elem.get_BoundingBox(null));
|
| | | var refLevel = elem.GetParameterByProName(new List<string> { "参照标高", "标高" })?.AsValueString();
|
| | | return new OtherModel(new ElementModel
|
| | | {
|
| | | 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));
|
| | | }
|
| | | }
|
| | | return result;
|
| | | 名称 = elemName,
|
| | | 编号 = elemId,
|
| | | 包围框 = box,
|
| | | 系统类型 = sysName,
|
| | | 楼层 = refLevel,
|
| | | 连接构件 = ElementExtense2.GetLinkedElementIds(elemId)
|
| | | });
|
| | | }
|
| | |
|
| | | //public override List<Tuple<string, string>> PropertyParse(Element elem)
|
| | | //{
|
| | | // var result = new List<Tuple<string, string>>();
|
| | | // var instance = elem.Document.GetElement(elem.Id);
|
| | | // var fi = instance 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));
|
| | | // }
|
| | | // }
|
| | | // return result;
|
| | | //}
|
| | | }
|
| | | }
|