From 06a1e1eb4ca614efc53d7c3082b861234ae0a479 Mon Sep 17 00:00:00 2001 From: cloudflight <cloudflight@126.com> Date: 星期六, 23 十一月 2024 14:03:22 +0800 Subject: [PATCH] 1、管网添加能量统计扩展方法AnalyzeEnergy:(统计类型包括起始总能量、输入能量、势能损失、沿程损失、剩余能量(末端)) --- Service/HStation.Service.Revit.Core/01-model/RevitModel_Method.cs | 481 +++++++++++++++++++++++++++++++--------------------- 1 files changed, 285 insertions(+), 196 deletions(-) diff --git a/Service/HStation.Service.Revit.Core/01-model/RevitModel_Method.cs b/Service/HStation.Service.Revit.Core/01-model/RevitModel_Method.cs index b90609d..fdbf379 100644 --- a/Service/HStation.Service.Revit.Core/01-model/RevitModel_Method.cs +++ b/Service/HStation.Service.Revit.Core/01-model/RevitModel_Method.cs @@ -8,318 +8,407 @@ /// <summary> /// 鑾峰彇鎵�鏈夌粍浠� /// </summary> - public List<IRevitParter> GetAllParters() + public List<RevitParter> GetAllParters() { - var list = new List<IRevitParter>(); + var list = new List<RevitParter>(); if (this.Reservoirs != null && this.Reservoirs.Count > 0) - { + {//姘村簱 list.AddRange(this.Reservoirs); } if (this.Tanks != null && this.Tanks.Count > 0) - { + {//姘存睜 list.AddRange(this.Tanks); } if (this.Waterboxs != null && this.Waterboxs.Count > 0) - { + {//姘寸 list.AddRange(this.Waterboxs); } if (this.Junctions != null && this.Junctions.Count > 0) - { + {//杩炴帴鑺傜偣 list.AddRange(this.Junctions); } - if (this.Nozzles != null && this.Nozzles.Count > 0) - { - list.AddRange(this.Nozzles); - } - if (this.Hydrants != null && this.Hydrants.Count > 0) - { - list.AddRange(this.Hydrants); - } - if (this.Flowmeters != null && this.Flowmeters.Count > 0) - { - list.AddRange(this.Flowmeters); - } - if (this.Pressmeters != null && this.Pressmeters.Count > 0) - { - list.AddRange(this.Pressmeters); + if (this.Bluntheads != null && this.Bluntheads.Count > 0) + {//闂峰ご + list.AddRange(this.Bluntheads); } if (this.Elbows != null && this.Elbows.Count > 0) - { + {//寮ご list.AddRange(this.Elbows); } if (this.Threelinks != null && this.Threelinks.Count > 0) - { + {//涓夐�� list.AddRange(this.Threelinks); } if (this.Fourlinks != null && this.Fourlinks.Count > 0) - { + {//鍥涢�� list.AddRange(this.Fourlinks); } - if (this.Bluntheads != null && this.Bluntheads.Count > 0) - { - list.AddRange(this.Bluntheads); + if (this.Nozzles != null && this.Nozzles.Count > 0) + {//鍠峰槾 + list.AddRange(this.Nozzles); + } + if (this.Hydrants != null && this.Hydrants.Count > 0) + {//娑堢伀鏍� + list.AddRange(this.Hydrants); + } + if (this.Meters != null && this.Meters.Count > 0) + {//姘磋〃 + list.AddRange(this.Meters); + } + if (this.Flowmeters != null && this.Flowmeters.Count > 0) + {//娴侀噺璁� + list.AddRange(this.Flowmeters); + } + if (this.Pressmeters != null && this.Pressmeters.Count > 0) + {//鍘嬪姏琛� + list.AddRange(this.Pressmeters); } if (this.Pipes != null && this.Pipes.Count > 0) - { + {//绠¢亾 list.AddRange(this.Pipes); } if (this.Translations != null && this.Translations.Count > 0) - { + {//杩囨浮浠� list.AddRange(this.Translations); } if (this.Pumps != null && this.Pumps.Count > 0) - { + {//姘存车 list.AddRange(this.Pumps); } if (this.Valves != null && this.Valves.Count > 0) - { + {//闃�闂� list.AddRange(this.Valves); } - + if (this.Exchangers != null && this.Exchangers.Count > 0) + {//鎹㈢儹鍣� + list.AddRange(this.Exchangers); + } + if (this.Compressors != null && this.Compressors.Count > 0) + {//绌哄帇鏈� + list.AddRange(this.Compressors); + } return list; - } /// <summary> - /// 鑾峰彇鎵�鏈夎妭鐐� + /// 鑾峰彇鎵�鏈夊彲瑙佺粍浠� /// </summary> - public List<IRevitNode> GetAllNodes() + public List<RevitVisual> GetAllVisuals() { - var list = new List<IRevitNode>(); + var list = new List<RevitVisual>(); if (this.Reservoirs != null && this.Reservoirs.Count > 0) - { + {//姘村簱 list.AddRange(this.Reservoirs); } if (this.Tanks != null && this.Tanks.Count > 0) - { + {//姘存睜 list.AddRange(this.Tanks); } if (this.Waterboxs != null && this.Waterboxs.Count > 0) - { + {//姘寸 list.AddRange(this.Waterboxs); } if (this.Junctions != null && this.Junctions.Count > 0) - { + {//杩炴帴鑺傜偣 list.AddRange(this.Junctions); } - if (this.Nozzles != null && this.Nozzles.Count > 0) - { - list.AddRange(this.Nozzles); - } - if (this.Hydrants != null && this.Hydrants.Count > 0) - { - list.AddRange(this.Hydrants); - } - if (this.Flowmeters != null && this.Flowmeters.Count > 0) - { - list.AddRange(this.Flowmeters); - } - if (this.Pressmeters != null && this.Pressmeters.Count > 0) - { - list.AddRange(this.Pressmeters); + if (this.Bluntheads != null && this.Bluntheads.Count > 0) + {//闂峰ご + list.AddRange(this.Bluntheads); } if (this.Elbows != null && this.Elbows.Count > 0) - { + {//寮ご list.AddRange(this.Elbows); } if (this.Threelinks != null && this.Threelinks.Count > 0) - { + {//涓夐�� list.AddRange(this.Threelinks); } if (this.Fourlinks != null && this.Fourlinks.Count > 0) - { + {//鍥涢�� list.AddRange(this.Fourlinks); } - if (this.Bluntheads != null && this.Bluntheads.Count > 0) - { - list.AddRange(this.Bluntheads); + if (this.Nozzles != null && this.Nozzles.Count > 0) + {//鍠峰槾 + list.AddRange(this.Nozzles); } - - - return list; - } - - /// <summary> - /// 鑾峰彇鎵�鏈夋按婧� - /// </summary> - /// <returns></returns> - public List<IRevitNode> GetAllWaterSources() - { - var list = new List<IRevitNode>(); - if (this.Reservoirs != null && this.Reservoirs.Count > 0) - { - list.AddRange(this.Reservoirs); + if (this.Hydrants != null && this.Hydrants.Count > 0) + {//娑堢伀鏍� + list.AddRange(this.Hydrants); } - if (this.Tanks != null && this.Tanks.Count > 0) - { - list.AddRange(this.Tanks); + if (this.Meters != null && this.Meters.Count > 0) + {//姘磋〃 + list.AddRange(this.Meters); } - if (this.Waterboxs != null && this.Waterboxs.Count > 0) - { - list.AddRange(this.Waterboxs); + if (this.Flowmeters != null && this.Flowmeters.Count > 0) + {//娴侀噺璁� + list.AddRange(this.Flowmeters); } - return list; - } - - /// <summary> - /// 鑾峰彇鎵�鏈夌娈� - /// </summary> - public List<IRevitLink> GetAllLinks() - { - var list = new List<IRevitLink>(); - + if (this.Pressmeters != null && this.Pressmeters.Count > 0) + {//鍘嬪姏琛� + list.AddRange(this.Pressmeters); + } if (this.Pipes != null && this.Pipes.Count > 0) - { + {//绠¢亾 list.AddRange(this.Pipes); } if (this.Translations != null && this.Translations.Count > 0) - { + {//杩囨浮浠� list.AddRange(this.Translations); } if (this.Pumps != null && this.Pumps.Count > 0) - { + {//姘存车 list.AddRange(this.Pumps); } if (this.Valves != null && this.Valves.Count > 0) - { + {//闃�闂� list.AddRange(this.Valves); } - - - return list; - - } - - /// <summary> - /// 鑾峰彇鎵�鏈夎繛鎺ヨ妭鐐� - /// </summary> - public List<IRevitJunction> GetAllJunctions() - { - var list = new List<IRevitJunction>(); - if (this.Junctions != null && this.Junctions.Count > 0) - { - list.AddRange(this.Junctions); + if (this.Exchangers != null && this.Exchangers.Count > 0) + {//鎹㈢儹鍣� + list.AddRange(this.Exchangers); } - if (this.Nozzles != null && this.Nozzles.Count > 0) - { - list.AddRange(this.Nozzles); + if (this.Compressors != null && this.Compressors.Count > 0) + {//绌哄帇鏈� + list.AddRange(this.Compressors); } - if (this.Hydrants != null && this.Hydrants.Count > 0) - { - list.AddRange(this.Hydrants); - } - if (this.Flowmeters != null && this.Flowmeters.Count > 0) - { - list.AddRange(this.Flowmeters); - } - if (this.Pressmeters != null && this.Pressmeters.Count > 0) - { - list.AddRange(this.Pressmeters); - } - if (this.Elbows != null && this.Elbows.Count > 0) - { - list.AddRange(this.Elbows); - } - if (this.Threelinks != null && this.Threelinks.Count > 0) - { - list.AddRange(this.Threelinks); - } - if (this.Fourlinks != null && this.Fourlinks.Count > 0) - { - list.AddRange(this.Fourlinks); - } - if (this.Bluntheads != null && this.Bluntheads.Count > 0) - { - list.AddRange(this.Bluntheads); - } - return list; } /// <summary> - /// 鑾峰彇鎵�鏈夋按姹� + /// 鑾峰彇鎵�鏈夎妭鐐圭粍浠� /// </summary> - /// <returns></returns> - public List<IRevitTank> GetAllTanks() + public List<RevitNode> GetAllNodes() { - var list = new List<IRevitTank>(); + var list = new List<RevitNode>(); + if (this.Reservoirs != null && this.Reservoirs.Count > 0) + {//姘村簱 + list.AddRange(this.Reservoirs); + } if (this.Tanks != null && this.Tanks.Count > 0) - { + {//姘存睜 list.AddRange(this.Tanks); } if (this.Waterboxs != null && this.Waterboxs.Count > 0) - { + {//姘寸 list.AddRange(this.Waterboxs); } - - return list; - } - - /// <summary> - /// 鑾峰彇鎵�鏈夋按搴� - /// </summary> - public List<IRevitReservoir> GetAllReservoirs() - { - var list = new List<IRevitReservoir>(); - if (this.Reservoirs != null && this.Reservoirs.Count > 0) - { - list.AddRange(this.Reservoirs); + if (this.Junctions != null && this.Junctions.Count > 0) + {//杩炴帴鑺傜偣 + list.AddRange(this.Junctions); + } + if (this.Bluntheads != null && this.Bluntheads.Count > 0) + {//闂峰ご + list.AddRange(this.Bluntheads); + } + if (this.Elbows != null && this.Elbows.Count > 0) + {//寮ご + list.AddRange(this.Elbows); + } + if (this.Threelinks != null && this.Threelinks.Count > 0) + {//涓夐�� + list.AddRange(this.Threelinks); + } + if (this.Fourlinks != null && this.Fourlinks.Count > 0) + {//鍥涢�� + list.AddRange(this.Fourlinks); + } + if (this.Nozzles != null && this.Nozzles.Count > 0) + {//鍠峰槾 + list.AddRange(this.Nozzles); + } + if (this.Hydrants != null && this.Hydrants.Count > 0) + {//娑堢伀鏍� + list.AddRange(this.Hydrants); + } + if (this.Meters != null && this.Meters.Count > 0) + {//姘磋〃 + list.AddRange(this.Meters); + } + if (this.Flowmeters != null && this.Flowmeters.Count > 0) + {//娴侀噺璁� + list.AddRange(this.Flowmeters); + } + if (this.Pressmeters != null && this.Pressmeters.Count > 0) + {//鍘嬪姏琛� + list.AddRange(this.Pressmeters); } return list; } /// <summary> - /// 鑾峰彇鎵�鏈夌閬� + /// 鑾峰彇鎵�鏈夋按婧愮粍浠� /// </summary> - public List<IRevitPipe> GetAllPipes() + public List<RevitSource> GetAllSources() { - var list = new List<IRevitPipe>(); + var list = new List<RevitSource>(); + if (this.Reservoirs != null && this.Reservoirs.Count > 0) + {//姘村簱 + list.AddRange(this.Reservoirs); + } + if (this.Tanks != null && this.Tanks.Count > 0) + {//姘存睜 + list.AddRange(this.Tanks); + } + if (this.Waterboxs != null && this.Waterboxs.Count > 0) + {//姘寸 + list.AddRange(this.Waterboxs); + } + return list; + } + + /// <summary> + /// 鑾峰彇鎵�鏈夎繛鎺ヨ妭鐐圭粍浠� + /// </summary> + public List<RevitJunction> GetAllJunctions() + { + var list = new List<RevitJunction>(); + if (this.Junctions != null && this.Junctions.Count > 0) + {//杩炴帴鑺傜偣 + list.AddRange(this.Junctions); + } + if (this.Bluntheads != null && this.Bluntheads.Count > 0) + {//闂峰ご + list.AddRange(this.Bluntheads); + } + if (this.Elbows != null && this.Elbows.Count > 0) + {//寮ご + list.AddRange(this.Elbows); + } + if (this.Threelinks != null && this.Threelinks.Count > 0) + {//涓夐�� + list.AddRange(this.Threelinks); + } + if (this.Fourlinks != null && this.Fourlinks.Count > 0) + {//鍥涢�� + list.AddRange(this.Fourlinks); + } + if (this.Nozzles != null && this.Nozzles.Count > 0) + {//鍠峰槾 + list.AddRange(this.Nozzles); + } + if (this.Hydrants != null && this.Hydrants.Count > 0) + {//娑堢伀鏍� + list.AddRange(this.Hydrants); + } + if (this.Meters != null && this.Meters.Count > 0) + {//姘磋〃 + list.AddRange(this.Meters); + } + if (this.Flowmeters != null && this.Flowmeters.Count > 0) + {//娴侀噺璁� + list.AddRange(this.Flowmeters); + } + if (this.Pressmeters != null && this.Pressmeters.Count > 0) + {//鍘嬪姏琛� + list.AddRange(this.Pressmeters); + } + return list; + } + + /// <summary> + /// 鑾峰彇鎵�鏈夋墿鏁e櫒缁勪欢 + /// </summary> + public List<RevitEmitter> GetAllEmitters() + { + var list = new List<RevitEmitter>(); + + if (this.Nozzles != null && this.Nozzles.Count > 0) + {//鍠峰槾 + list.AddRange(this.Nozzles); + } + if (this.Hydrants != null && this.Hydrants.Count > 0) + {//娑堢伀鏍� + list.AddRange(this.Hydrants); + } + + return list; + } + + /// <summary> + /// 鑾峰彇鎵�鏈夎繛鎺ョ粍浠� + /// </summary> + public List<RevitCoupling> GetAllCouplings() + { + var list = new List<RevitCoupling>(); + if (this.Bluntheads != null && this.Bluntheads.Count > 0) + {//闂峰ご + list.AddRange(this.Bluntheads); + } + if (this.Elbows != null && this.Elbows.Count > 0) + {//寮ご + list.AddRange(this.Elbows); + } + if (this.Threelinks != null && this.Threelinks.Count > 0) + {//涓夐�� + list.AddRange(this.Threelinks); + } + if (this.Fourlinks != null && this.Fourlinks.Count > 0) + {//鍥涢�� + list.AddRange(this.Fourlinks); + } + return list; + } + + /// <summary> + /// 鑾峰彇鎵�鏈夌娈电粍浠� + /// </summary> + public List<RevitLink> GetAllLinks() + { + var list = new List<RevitLink>(); if (this.Pipes != null && this.Pipes.Count > 0) - { + {//绠¢亾 list.AddRange(this.Pipes); } if (this.Translations != null && this.Translations.Count > 0) - { + {//杩囨浮浠� + list.AddRange(this.Translations); + } + if (this.Pumps != null && this.Pumps.Count > 0) + {//姘存车 + list.AddRange(this.Pumps); + } + if (this.Valves != null && this.Valves.Count > 0) + {//闃�闂� + list.AddRange(this.Valves); + } + if (this.Exchangers != null && this.Exchangers.Count > 0) + {//鎹㈢儹鍣� + list.AddRange(this.Exchangers); + } + if (this.Compressors != null && this.Compressors.Count > 0) + {//绌哄帇鏈� + list.AddRange(this.Compressors); + } + + return list; + + } + + /// <summary> + /// 鑾峰彇鎵�鏈夌閬撶粍浠� + /// </summary> + public List<RevitPipe> GetAllPipes() + { + var list = new List<RevitPipe>(); + + if (this.Pipes != null && this.Pipes.Count > 0) + {//绠¢亾 + list.AddRange(this.Pipes); + } + if (this.Translations != null && this.Translations.Count > 0) + {//杩囨浮浠� list.AddRange(this.Translations); } return list; } - /// <summary> - /// 鑾峰彇鎵�鏈夋按娉� - /// </summary> - public List<IRevitPump> GetAllPumps() - { - var list = new List<IRevitPump>(); - - if (this.Pumps != null && this.Pumps.Count > 0) - { - list.AddRange(this.Pumps); - } - - return list; - } - - /// <summary> - /// 鑾峰彇鎵�鏈夐榾闂� - /// </summary> - public List<IRevitValve> GetAllValves() - { - var list = new List<IRevitValve>(); - - if (this.Valves != null && this.Valves.Count > 0) - { - list.AddRange(this.Valves); - } - - return list; - } } -- Gitblit v1.9.3