using HStation.Model; using Yw.Model; namespace HStation.Hydro { /// /// 转换辅助类 /// public class TransferHelper { /// /// 从Revit转换 /// public static Yw.Model.HydroModelInfo FromRevit ( HStation.Model.RevitModel revitModel, out List allScenePropValueList, out List allDecoratorList, out string msg ) { msg = string.Empty; var hydro = new Yw.Model.HydroModelInfo(); hydro.Name = revitModel.Name; hydro.Code = null; hydro.Paras = null; hydro.Flags = null; hydro.TagName = null; hydro.Description = revitModel.Description; //场景属性 allScenePropValueList = new List(); //水库 if (revitModel.Reservoirs != null && revitModel.Reservoirs.Count > 0) { if (hydro.Reservoirs == null) { hydro.Reservoirs = new List(); } foreach (var revitReservoir in revitModel.Reservoirs) { var reservoir = FromRevit(revitReservoir, ref allScenePropValueList); //reservoir.PropStatusList = null;//临时代码 hydro.Reservoirs.Add(reservoir); } } //水池 if (revitModel.Tanks != null && revitModel.Tanks.Count > 0) { if (hydro.Tanks == null) { hydro.Tanks = new List(); } foreach (var revitTank in revitModel.Tanks) { var tank = FromRevit(revitTank, ref allScenePropValueList); //tank.PropStatusList = null;//临时代码 hydro.Tanks.Add(tank); } } //水箱 if (revitModel.Waterboxs != null && revitModel.Waterboxs.Count > 0) { if (hydro.Waterboxs == null) { hydro.Waterboxs = new List(); } foreach (var revitWaterbox in revitModel.Waterboxs) { var waterbox = FromRevit(revitWaterbox, ref allScenePropValueList); //waterbox.PropStatusList = null;//临时代码 hydro.Waterboxs.Add(waterbox); } } //连接节点 if (revitModel.Junctions != null && revitModel.Junctions.Count > 0) { if (hydro.Junctions == null) { hydro.Junctions = new List(); } foreach (var revitJunction in revitModel.Junctions) { var junction = FromRevit(revitJunction, ref allScenePropValueList); //junction.PropStatusList = null;//临时代码 hydro.Junctions.Add(junction); } } //闷头 if (revitModel.Bluntheads != null && revitModel.Bluntheads.Count > 0) { if (hydro.Bluntheads == null) { hydro.Bluntheads = new List(); } foreach (var revitBlunthead in revitModel.Bluntheads) { var blunthead = FromRevit(revitBlunthead, ref allScenePropValueList); //blunthead.PropStatusList = null;//临时代码 hydro.Bluntheads.Add(blunthead); } } //弯头 if (revitModel.Elbows != null && revitModel.Elbows.Count > 0) { if (hydro.Elbows == null) { hydro.Elbows = new List(); } foreach (var revitElbow in revitModel.Elbows) { var elbow = FromRevit(revitElbow, ref allScenePropValueList); //elbow.PropStatusList = null;//临时代码 hydro.Elbows.Add(elbow); } } //三通 if (revitModel.Threelinks != null && revitModel.Threelinks.Count > 0) { if (hydro.Threelinks == null) { hydro.Threelinks = new List(); } foreach (var revitThreelink in revitModel.Threelinks) { var threelink = FromRevit(revitThreelink, ref allScenePropValueList); //threelink.PropStatusList = null;//临时代码 hydro.Threelinks.Add(threelink); } } //四通 if (revitModel.Fourlinks != null && revitModel.Fourlinks.Count > 0) { if (hydro.Fourlinks == null) { hydro.Fourlinks = new List(); } foreach (var revitFourlink in revitModel.Fourlinks) { var fourlink = FromRevit(revitFourlink, ref allScenePropValueList); //fourlink.PropStatusList = null;//临时代码 hydro.Fourlinks.Add(fourlink); } } //消火栓 if (revitModel.Hydrants != null && revitModel.Hydrants.Count > 0) { if (hydro.Hydrants == null) { hydro.Hydrants = new List(); } foreach (var revitHydrant in revitModel.Hydrants) { var hydrant = FromRevit(revitHydrant, ref allScenePropValueList); //hydrant.PropStatusList = null;//临时代码 hydro.Hydrants.Add(hydrant); } } //喷嘴 if (revitModel.Nozzles != null && revitModel.Nozzles.Count > 0) { if (hydro.Nozzles == null) { hydro.Nozzles = new List(); } foreach (var revitNozzle in revitModel.Nozzles) { var nozzle = FromRevit(revitNozzle, ref allScenePropValueList); //nozzle.PropStatusList = null;//临时代码 hydro.Nozzles.Add(nozzle); } } //冷却塔 if (revitModel.Coolings != null && revitModel.Coolings.Count > 0) { if (hydro.Coolings == null) { hydro.Coolings = new List(); } foreach (var revitCooling in revitModel.Coolings) { var cooling = FromRevit(revitCooling, ref allScenePropValueList); //cooling.PropStatusList = null;//临时代码 hydro.Coolings.Add(cooling); } } //水表 if (revitModel.Meters != null && revitModel.Meters.Count > 0) { if (hydro.Meters == null) { hydro.Meters = new List(); } foreach (var revitMeter in revitModel.Meters) { var meter = FromRevit(revitMeter, ref allScenePropValueList); //meter.PropStatusList = null;//临时代码 hydro.Meters.Add(meter); } } //流量计 if (revitModel.Flowmeters != null && revitModel.Flowmeters.Count > 0) { if (hydro.Flowmeters == null) { hydro.Flowmeters = new List(); } foreach (var revitFlowmeter in revitModel.Flowmeters) { var flowmeter = FromRevit(revitFlowmeter, ref allScenePropValueList); //flowmeter.PropStatusList = null;//临时代码 hydro.Flowmeters.Add(flowmeter); } } //压力表 if (revitModel.Pressmeters != null && revitModel.Pressmeters.Count > 0) { if (hydro.Pressmeters == null) { hydro.Pressmeters = new List(); } foreach (var revitPressmeter in revitModel.Pressmeters) { var pressmeter = FromRevit(revitPressmeter, ref allScenePropValueList); //pressmeter.PropStatusList = null;//临时代码 hydro.Pressmeters.Add(pressmeter); } } //管道 if (revitModel.Pipes != null && revitModel.Pipes.Count > 0) { if (hydro.Pipes == null) { hydro.Pipes = new List(); } foreach (var revitPipe in revitModel.Pipes) { var pipe = FromRevit(revitPipe, ref allScenePropValueList); //pipe.PropStatusList = null;//临时代码 hydro.Pipes.Add(pipe); } } //过渡件 if (revitModel.Translations != null && revitModel.Translations.Count > 0) { if (hydro.Translations == null) { hydro.Translations = new List(); } foreach (var revitTranslation in revitModel.Translations) { var translation = FromRevit(revitTranslation, ref allScenePropValueList); //translation.PropStatusList = null;//临时代码 hydro.Translations.Add(translation); } } //水泵 if (revitModel.Pumps != null && revitModel.Pumps.Count > 0) { if (hydro.Pumps == null) { hydro.Pumps = new List(); } foreach (var revitPump in revitModel.Pumps) { var pump = FromRevit(revitPump, ref allScenePropValueList); //pump.PropStatusList = null;//临时代码 hydro.Pumps.Add(pump); } } //阀门 if (revitModel.Valves != null && revitModel.Valves.Count > 0) { if (hydro.Valves == null) { hydro.Valves = new List(); } foreach (var revitValve in revitModel.Valves) { var valve = FromRevit(revitValve, ref allScenePropValueList); //valve.PropStatusList = null;//临时代码 hydro.Valves.Add(valve); } } //换热器 if (revitModel.Exchangers != null && revitModel.Exchangers.Count > 0) { if (hydro.Exchangers == null) { hydro.Exchangers = new List(); } foreach (var revitExchanger in revitModel.Exchangers) { var exchanger = FromRevit(revitExchanger, ref allScenePropValueList); //exchanger.PropStatusList = null;//临时代码 hydro.Exchangers.Add(exchanger); } } //空压机 if (revitModel.Compressors != null && revitModel.Compressors.Count > 0) { if (hydro.Compressors == null) { hydro.Compressors = new List(); } foreach (var revitCompressor in revitModel.Compressors) { var compressor = FromRevit(revitCompressor, ref allScenePropValueList); //compressor.PropStatusList = null;//临时代码 hydro.Compressors.Add(compressor); } } //装饰件 allDecoratorList = new List(); if (revitModel.Decorators != null && revitModel.Decorators.Count > 0) { foreach (var revitDecorator in revitModel.Decorators) { var decorator = new Yw.Model.HydroDecoratorInfo(); decorator.Scene = HStation.Revit.ConstParas.Scene; decorator.Name = revitDecorator.Name; decorator.Code = revitDecorator.Id; decorator.Category = revitDecorator.Category; decorator.Decoration = revitDecorator.Decoration; decorator.Description = revitDecorator.Description; allDecoratorList.Add(decorator); } } return hydro; } //水库 private static Yw.Model.HydroReservoirInfo FromRevit (HStation.Model.RevitReservoir revitReservoir, ref List allScenePropValueList) { if (revitReservoir == null) { return default; } var reservoir = new Yw.Model.HydroReservoirInfo(); reservoir.Catalog = Yw.Hydro.ParterCatalog.Reservoir; reservoir.Name = revitReservoir.Name; reservoir.UpdatePropStatus(nameof(reservoir.Name), revitReservoir, nameof(revitReservoir.Name)); reservoir.Code = revitReservoir.Id; reservoir.UpdatePropStatus(nameof(reservoir.Code), revitReservoir, nameof(revitReservoir.Id)); reservoir.ModelType = revitReservoir.ModelType; reservoir.UpdatePropStatus(nameof(reservoir.ModelType), revitReservoir, nameof(revitReservoir.ModelType)); reservoir.Flags = revitReservoir.Flags; reservoir.UpdatePropStatus(nameof(reservoir.Flags), revitReservoir, nameof(revitReservoir.Flags)); reservoir.Description = revitReservoir.Description; reservoir.UpdatePropStatus(nameof(reservoir.Description), revitReservoir, nameof(revitReservoir.Description)); reservoir.FlowDirectionX = Yw.Hydro.FlowDirection.Positive; reservoir.UpdatePropStatus(nameof(reservoir.FlowDirectionX), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); reservoir.FlowDirectionY = Yw.Hydro.FlowDirection.Positive; reservoir.UpdatePropStatus(nameof(reservoir.FlowDirectionY), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); reservoir.PoolElev = revitReservoir.PoolElev; reservoir.UpdatePropStatus(nameof(reservoir.PoolElev), revitReservoir, nameof(revitReservoir.PoolElev)); reservoir.Head = revitReservoir.Head; reservoir.UpdatePropStatus(nameof(reservoir.Head), revitReservoir, nameof(revitReservoir.Head)); reservoir.HeadPattern = revitReservoir.HeadPattern; reservoir.UpdatePropStatus(nameof(reservoir.HeadPattern), revitReservoir, nameof(revitReservoir.HeadPattern)); reservoir.Position2d = new Yw.Model.Hydro.Position2d(revitReservoir.Position.X, revitReservoir.Position.Y); reservoir.UpdatePropStatus(nameof(reservoir.Position2d), revitReservoir, nameof(revitReservoir.Position)); reservoir.Position3d = new Yw.Model.Hydro.Position3d(revitReservoir.Position.X, revitReservoir.Position.Y, revitReservoir.Position.Z); reservoir.UpdatePropStatus(nameof(reservoir.Position3d), revitReservoir, nameof(revitReservoir.Position)); if (allScenePropValueList == null) { allScenePropValueList = new List(); } var scenePropValueList = revitReservoir.PropValueList?.Select(x => new Yw.Model.HydroParterScenePropValueInfo() { Parter = revitReservoir.Id, Scene = HStation.Revit.ConstParas.Scene, PropName = x.PropName, PropValue = x.PropValue }).ToList(); if (scenePropValueList != null && scenePropValueList.Count > 0) { allScenePropValueList.AddRange(scenePropValueList); } return reservoir; } //水池 private static Yw.Model.HydroTankInfo FromRevit (HStation.Model.RevitTank revitTank, ref List allScenePropValueList) { if (revitTank == null) { return default; } var tank = new Yw.Model.HydroTankInfo(); tank.Catalog = Yw.Hydro.ParterCatalog.Tank; tank.Name = revitTank.Name; tank.UpdatePropStatus(nameof(tank.Name), revitTank, nameof(revitTank.Name)); tank.Code = revitTank.Id; tank.UpdatePropStatus(nameof(tank.Code), revitTank, nameof(revitTank.Id)); tank.ModelType = revitTank.ModelType; tank.UpdatePropStatus(nameof(tank.ModelType), revitTank, nameof(revitTank.ModelType)); tank.Flags = revitTank.Flags; tank.UpdatePropStatus(nameof(tank.Flags), revitTank, nameof(revitTank.Flags)); tank.Description = revitTank.Description; tank.UpdatePropStatus(nameof(tank.Description), revitTank, nameof(revitTank.Description)); tank.FlowDirectionX = Yw.Hydro.FlowDirection.Positive; tank.UpdatePropStatus(nameof(tank.FlowDirectionX), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); tank.FlowDirectionY = Yw.Hydro.FlowDirection.Positive; tank.UpdatePropStatus(nameof(tank.FlowDirectionY), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); tank.PoolElev = revitTank.PoolElev; tank.UpdatePropStatus(nameof(tank.PoolElev), revitTank, nameof(revitTank.PoolElev)); tank.InitLevel = revitTank.InitLevel; tank.UpdatePropStatus(nameof(tank.InitLevel), revitTank, nameof(revitTank.InitLevel)); tank.MinLevel = revitTank.MinLevel; tank.UpdatePropStatus(nameof(tank.MinLevel), revitTank, nameof(revitTank.MinLevel)); tank.MaxLevel = revitTank.MaxLevel; tank.UpdatePropStatus(nameof(tank.MaxLevel), revitTank, nameof(revitTank.MaxLevel)); tank.DN = revitTank.DN; tank.UpdatePropStatus(nameof(tank.DN), revitTank, nameof(revitTank.DN)); tank.MinVol = revitTank.MinVol; tank.UpdatePropStatus(nameof(tank.MinVol), revitTank, nameof(revitTank.MinVol)); tank.VolCurve = revitTank.VolCurve; tank.UpdatePropStatus(nameof(tank.VolCurve), revitTank, nameof(revitTank.VolCurve)); tank.OverFlow = revitTank.OverFlow; tank.UpdatePropStatus(nameof(tank.OverFlow), revitTank, nameof(revitTank.OverFlow)); tank.Position2d = new Yw.Model.Hydro.Position2d(revitTank.Position.X, revitTank.Position.Y); tank.UpdatePropStatus(nameof(tank.Position2d), revitTank, nameof(revitTank.Position)); tank.Position3d = new Yw.Model.Hydro.Position3d(revitTank.Position.X, revitTank.Position.Y, revitTank.Position.Z); tank.UpdatePropStatus(nameof(tank.Position3d), revitTank, nameof(revitTank.Position)); if (allScenePropValueList == null) { allScenePropValueList = new List(); } var scenePropValueList = revitTank.PropValueList?.Select(x => new Yw.Model.HydroParterScenePropValueInfo() { Parter = revitTank.Id, Scene = HStation.Revit.ConstParas.Scene, PropName = x.PropName, PropValue = x.PropValue }).ToList(); if (scenePropValueList != null && scenePropValueList.Count > 0) { allScenePropValueList.AddRange(scenePropValueList); } return tank; } //水池 private static Yw.Model.HydroWaterboxInfo FromRevit (HStation.Model.RevitWaterbox revitWaterbox, ref List allScenePropValueList) { if (revitWaterbox == null) { return default; } var waterbox = new Yw.Model.HydroWaterboxInfo(); waterbox.Catalog = Yw.Hydro.ParterCatalog.Waterbox; waterbox.Name = revitWaterbox.Name; waterbox.UpdatePropStatus(nameof(waterbox.Name), revitWaterbox, nameof(revitWaterbox.Name)); waterbox.Code = revitWaterbox.Id; waterbox.UpdatePropStatus(nameof(waterbox.Code), revitWaterbox, nameof(revitWaterbox.Id)); waterbox.ModelType = revitWaterbox.ModelType; waterbox.UpdatePropStatus(nameof(waterbox.ModelType), revitWaterbox, nameof(revitWaterbox.ModelType)); waterbox.Flags = revitWaterbox.Flags; waterbox.UpdatePropStatus(nameof(waterbox.Flags), revitWaterbox, nameof(revitWaterbox.Flags)); waterbox.Description = revitWaterbox.Description; waterbox.UpdatePropStatus(nameof(waterbox.Description), revitWaterbox, nameof(revitWaterbox.Description)); waterbox.FlowDirectionX = Yw.Hydro.FlowDirection.Positive; waterbox.UpdatePropStatus(nameof(waterbox.FlowDirectionX), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); waterbox.FlowDirectionY = Yw.Hydro.FlowDirection.Positive; waterbox.UpdatePropStatus(nameof(waterbox.FlowDirectionY), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); waterbox.PoolElev = revitWaterbox.PoolElev; waterbox.UpdatePropStatus(nameof(waterbox.PoolElev), revitWaterbox, nameof(revitWaterbox.PoolElev)); waterbox.InitLevel = revitWaterbox.InitLevel; waterbox.UpdatePropStatus(nameof(waterbox.InitLevel), revitWaterbox, nameof(revitWaterbox.InitLevel)); waterbox.MinLevel = revitWaterbox.MinLevel; waterbox.UpdatePropStatus(nameof(waterbox.MinLevel), revitWaterbox, nameof(revitWaterbox.MinLevel)); waterbox.MaxLevel = revitWaterbox.MaxLevel; waterbox.UpdatePropStatus(nameof(waterbox.MaxLevel), revitWaterbox, nameof(revitWaterbox.MaxLevel)); waterbox.DN = revitWaterbox.DN; waterbox.UpdatePropStatus(nameof(waterbox.DN), revitWaterbox, nameof(revitWaterbox.DN)); waterbox.MinVol = revitWaterbox.MinVol; waterbox.UpdatePropStatus(nameof(waterbox.MinVol), revitWaterbox, nameof(revitWaterbox.MinVol)); waterbox.VolCurve = revitWaterbox.VolCurve; waterbox.UpdatePropStatus(nameof(waterbox.VolCurve), revitWaterbox, nameof(revitWaterbox.VolCurve)); waterbox.OverFlow = revitWaterbox.OverFlow; waterbox.UpdatePropStatus(nameof(waterbox.OverFlow), revitWaterbox, nameof(revitWaterbox.OverFlow)); waterbox.Position2d = new Yw.Model.Hydro.Position2d(revitWaterbox.Position.X, revitWaterbox.Position.Y); waterbox.UpdatePropStatus(nameof(waterbox.Position2d), revitWaterbox, nameof(revitWaterbox.Position)); waterbox.Position3d = new Yw.Model.Hydro.Position3d(revitWaterbox.Position.X, revitWaterbox.Position.Y, revitWaterbox.Position.Z); waterbox.UpdatePropStatus(nameof(waterbox.Position3d), revitWaterbox, nameof(revitWaterbox.Position)); if (allScenePropValueList == null) { allScenePropValueList = new List(); } var scenePropValueList = revitWaterbox.PropValueList?.Select(x => new Yw.Model.HydroParterScenePropValueInfo() { Parter = revitWaterbox.Id, Scene = HStation.Revit.ConstParas.Scene, PropName = x.PropName, PropValue = x.PropValue }).ToList(); if (scenePropValueList != null && scenePropValueList.Count > 0) { allScenePropValueList.AddRange(scenePropValueList); } return waterbox; } //连接节点 private static Yw.Model.HydroJunctionInfo FromRevit (HStation.Model.RevitJunction revitJunction, ref List allScenePropValueList) { if (revitJunction == null) { return default; } var junction = new Yw.Model.HydroJunctionInfo(); junction.Catalog = Yw.Hydro.ParterCatalog.Junction; junction.Name = revitJunction.Name; junction.UpdatePropStatus(nameof(junction.Name), revitJunction, nameof(revitJunction.Name)); junction.Code = revitJunction.Id; junction.UpdatePropStatus(nameof(junction.Code), revitJunction, nameof(revitJunction.Id)); junction.ModelType = revitJunction.ModelType; junction.UpdatePropStatus(nameof(junction.ModelType), revitJunction, nameof(revitJunction.ModelType)); junction.Flags = revitJunction.Flags; junction.UpdatePropStatus(nameof(junction.Flags), revitJunction, nameof(revitJunction.Flags)); junction.Description = revitJunction.Description; junction.UpdatePropStatus(nameof(junction.Description), revitJunction, nameof(revitJunction.Description)); junction.FlowDirectionX = Yw.Hydro.FlowDirection.Positive; junction.UpdatePropStatus(nameof(junction.FlowDirectionX), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); junction.FlowDirectionY = Yw.Hydro.FlowDirection.Positive; junction.UpdatePropStatus(nameof(junction.FlowDirectionY), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); junction.Elev = revitJunction.Elev; junction.UpdatePropStatus(nameof(junction.Elev), revitJunction, nameof(revitJunction.Elev)); junction.MinorLoss = revitJunction.MinorLoss; junction.UpdatePropStatus(nameof(junction.MinorLoss), revitJunction, nameof(revitJunction.MinorLoss)); junction.Demand = revitJunction.Demand; junction.UpdatePropStatus(nameof(junction.Demand), revitJunction, nameof(revitJunction.Demand)); junction.DemandPattern = revitJunction.DemandPattern; junction.UpdatePropStatus(nameof(junction.DemandPattern), revitJunction, nameof(revitJunction.DemandPattern)); junction.Position2d = new Yw.Model.Hydro.Position2d(revitJunction.Position.X, revitJunction.Position.Y); junction.UpdatePropStatus(nameof(junction.Position2d), revitJunction, nameof(revitJunction.Position)); junction.Position3d = new Yw.Model.Hydro.Position3d(revitJunction.Position.X, revitJunction.Position.Y, revitJunction.Position.Z); junction.UpdatePropStatus(nameof(junction.Position3d), revitJunction, nameof(revitJunction.Position)); if (allScenePropValueList == null) { allScenePropValueList = new List(); } var scenePropValueList = revitJunction.PropValueList?.Select(x => new Yw.Model.HydroParterScenePropValueInfo() { Parter = revitJunction.Id, Scene = HStation.Revit.ConstParas.Scene, PropName = x.PropName, PropValue = x.PropValue }).ToList(); if (scenePropValueList != null && scenePropValueList.Count > 0) { allScenePropValueList.AddRange(scenePropValueList); } return junction; } //闷头 private static Yw.Model.HydroBluntheadInfo FromRevit (HStation.Model.RevitBlunthead revitBlunthead, ref List allScenePropValueList) { if (revitBlunthead == null) { return default; } var blunthead = new Yw.Model.HydroBluntheadInfo(); blunthead.Catalog = Yw.Hydro.ParterCatalog.Blunthead; blunthead.Name = revitBlunthead.Name; blunthead.UpdatePropStatus(nameof(blunthead.Name), revitBlunthead, nameof(revitBlunthead.Name)); blunthead.Code = revitBlunthead.Id; blunthead.UpdatePropStatus(nameof(blunthead.Code), revitBlunthead, nameof(revitBlunthead.Id)); blunthead.ModelType = revitBlunthead.ModelType; blunthead.UpdatePropStatus(nameof(blunthead.ModelType), revitBlunthead, nameof(revitBlunthead.ModelType)); blunthead.Flags = revitBlunthead.Flags; blunthead.UpdatePropStatus(nameof(blunthead.Flags), revitBlunthead, nameof(revitBlunthead.Flags)); blunthead.Description = revitBlunthead.Description; blunthead.UpdatePropStatus(nameof(blunthead.Description), revitBlunthead, nameof(revitBlunthead.Description)); blunthead.FlowDirectionX = Yw.Hydro.FlowDirection.Positive; blunthead.UpdatePropStatus(nameof(blunthead.FlowDirectionX), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); blunthead.FlowDirectionY = Yw.Hydro.FlowDirection.Positive; blunthead.UpdatePropStatus(nameof(blunthead.FlowDirectionY), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); blunthead.Elev = revitBlunthead.Elev; blunthead.UpdatePropStatus(nameof(blunthead.Elev), revitBlunthead, nameof(revitBlunthead.Elev)); blunthead.MinorLoss = revitBlunthead.MinorLoss; blunthead.UpdatePropStatus(nameof(blunthead.MinorLoss), revitBlunthead, nameof(revitBlunthead.MinorLoss)); blunthead.Demand = revitBlunthead.Demand; blunthead.UpdatePropStatus(nameof(blunthead.Demand), revitBlunthead, nameof(revitBlunthead.Demand)); blunthead.DemandPattern = revitBlunthead.DemandPattern; blunthead.UpdatePropStatus(nameof(blunthead.DemandPattern), revitBlunthead, nameof(revitBlunthead.DemandPattern)); blunthead.Position2d = new Yw.Model.Hydro.Position2d(revitBlunthead.Position.X, revitBlunthead.Position.Y); blunthead.UpdatePropStatus(nameof(blunthead.Position2d), revitBlunthead, nameof(revitBlunthead.Position)); blunthead.Position3d = new Yw.Model.Hydro.Position3d(revitBlunthead.Position.X, revitBlunthead.Position.Y, revitBlunthead.Position.Z); blunthead.UpdatePropStatus(nameof(blunthead.Position3d), revitBlunthead, nameof(revitBlunthead.Position)); blunthead.Material = revitBlunthead.Material; blunthead.UpdatePropStatus(nameof(blunthead.Material), revitBlunthead, nameof(revitBlunthead.Material)); blunthead.Caliber = revitBlunthead.Caliber; blunthead.UpdatePropStatus(nameof(blunthead.Caliber), revitBlunthead, nameof(revitBlunthead.Caliber)); if (allScenePropValueList == null) { allScenePropValueList = new List(); } var scenePropValueList = revitBlunthead.PropValueList?.Select(x => new Yw.Model.HydroParterScenePropValueInfo() { Parter = revitBlunthead.Id, Scene = HStation.Revit.ConstParas.Scene, PropName = x.PropName, PropValue = x.PropValue }).ToList(); if (scenePropValueList != null && scenePropValueList.Count > 0) { allScenePropValueList.AddRange(scenePropValueList); } return blunthead; } //弯头 private static Yw.Model.HydroElbowInfo FromRevit (HStation.Model.RevitElbow revitElbow, ref List allScenePropValueList) { if (revitElbow == null) { return default; } var elbow = new Yw.Model.HydroElbowInfo(); elbow.Catalog = Yw.Hydro.ParterCatalog.Elbow; elbow.Name = revitElbow.Name; elbow.UpdatePropStatus(nameof(elbow.Name), revitElbow, nameof(revitElbow.Name)); elbow.Code = revitElbow.Id; elbow.UpdatePropStatus(nameof(elbow.Code), revitElbow, nameof(revitElbow.Id)); elbow.ModelType = revitElbow.ModelType; elbow.UpdatePropStatus(nameof(elbow.ModelType), revitElbow, nameof(revitElbow.ModelType)); elbow.Flags = revitElbow.Flags; elbow.UpdatePropStatus(nameof(elbow.Flags), revitElbow, nameof(revitElbow.Flags)); elbow.Description = revitElbow.Description; elbow.UpdatePropStatus(nameof(elbow.Description), revitElbow, nameof(revitElbow.Description)); elbow.FlowDirectionX = Yw.Hydro.FlowDirection.Positive; elbow.UpdatePropStatus(nameof(elbow.FlowDirectionX), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); elbow.FlowDirectionY = Yw.Hydro.FlowDirection.Positive; elbow.UpdatePropStatus(nameof(elbow.FlowDirectionY), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); elbow.Elev = revitElbow.Elev; elbow.UpdatePropStatus(nameof(elbow.Elev), revitElbow, nameof(revitElbow.Elev)); elbow.MinorLoss = revitElbow.MinorLoss; elbow.UpdatePropStatus(nameof(elbow.MinorLoss), revitElbow, nameof(revitElbow.MinorLoss)); elbow.Demand = revitElbow.Demand; elbow.UpdatePropStatus(nameof(elbow.Demand), revitElbow, nameof(revitElbow.Demand)); elbow.DemandPattern = revitElbow.DemandPattern; elbow.UpdatePropStatus(nameof(elbow.DemandPattern), revitElbow, nameof(revitElbow.DemandPattern)); elbow.Position2d = new Yw.Model.Hydro.Position2d(revitElbow.Position.X, revitElbow.Position.Y); elbow.UpdatePropStatus(nameof(elbow.Position2d), revitElbow, nameof(revitElbow.Position)); elbow.Position3d = new Yw.Model.Hydro.Position3d(revitElbow.Position.X, revitElbow.Position.Y, revitElbow.Position.Z); elbow.UpdatePropStatus(nameof(elbow.Position3d), revitElbow, nameof(revitElbow.Position)); elbow.Material = revitElbow.Material; elbow.UpdatePropStatus(nameof(elbow.Material), revitElbow, nameof(revitElbow.Material)); elbow.Caliber = revitElbow.Caliber; elbow.UpdatePropStatus(nameof(elbow.Caliber), revitElbow, nameof(revitElbow.Caliber)); elbow.BendingAngle = revitElbow.BendingAngle; elbow.UpdatePropStatus(nameof(elbow.BendingAngle), revitElbow, nameof(revitElbow.BendingAngle)); elbow.ElbowType = revitElbow.ElbowType; elbow.UpdatePropStatus(nameof(elbow.ElbowType), revitElbow, nameof(revitElbow.ElbowType)); if (allScenePropValueList == null) { allScenePropValueList = new List(); } var scenePropValueList = revitElbow.PropValueList?.Select(x => new Yw.Model.HydroParterScenePropValueInfo() { Parter = revitElbow.Id, Scene = HStation.Revit.ConstParas.Scene, PropName = x.PropName, PropValue = x.PropValue }).ToList(); if (scenePropValueList != null && scenePropValueList.Count > 0) { allScenePropValueList.AddRange(scenePropValueList); } return elbow; } //三通 private static Yw.Model.HydroThreelinkInfo FromRevit (HStation.Model.RevitThreelink revitThreelink, ref List allScenePropValueList) { if (revitThreelink == null) { return default; } var threelink = new Yw.Model.HydroThreelinkInfo(); threelink.Catalog = Yw.Hydro.ParterCatalog.Threelink; threelink.Name = revitThreelink.Name; threelink.UpdatePropStatus(nameof(threelink.Name), revitThreelink, nameof(revitThreelink.Name)); threelink.Code = revitThreelink.Id; threelink.UpdatePropStatus(nameof(threelink.Code), revitThreelink, nameof(revitThreelink.Id)); threelink.ModelType = revitThreelink.ModelType; threelink.UpdatePropStatus(nameof(threelink.ModelType), revitThreelink, nameof(revitThreelink.ModelType)); threelink.Flags = revitThreelink.Flags; threelink.UpdatePropStatus(nameof(threelink.Flags), revitThreelink, nameof(revitThreelink.Flags)); threelink.Description = revitThreelink.Description; threelink.UpdatePropStatus(nameof(threelink.Description), revitThreelink, nameof(revitThreelink.Description)); threelink.FlowDirectionX = Yw.Hydro.FlowDirection.Positive; threelink.UpdatePropStatus(nameof(threelink.FlowDirectionX), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); threelink.FlowDirectionY = Yw.Hydro.FlowDirection.Positive; threelink.UpdatePropStatus(nameof(threelink.FlowDirectionY), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); threelink.Elev = revitThreelink.Elev; threelink.UpdatePropStatus(nameof(threelink.Elev), revitThreelink, nameof(revitThreelink.Elev)); threelink.MinorLoss = revitThreelink.MinorLoss; threelink.UpdatePropStatus(nameof(threelink.MinorLoss), revitThreelink, nameof(revitThreelink.MinorLoss)); threelink.Demand = revitThreelink.Demand; threelink.UpdatePropStatus(nameof(threelink.Demand), revitThreelink, nameof(revitThreelink.Demand)); threelink.DemandPattern = revitThreelink.DemandPattern; threelink.UpdatePropStatus(nameof(threelink.DemandPattern), revitThreelink, nameof(revitThreelink.DemandPattern)); threelink.Position2d = new Yw.Model.Hydro.Position2d(revitThreelink.Position.X, revitThreelink.Position.Y); threelink.UpdatePropStatus(nameof(threelink.Position2d), revitThreelink, nameof(revitThreelink.Position)); threelink.Position3d = new Yw.Model.Hydro.Position3d(revitThreelink.Position.X, revitThreelink.Position.Y, revitThreelink.Position.Z); threelink.UpdatePropStatus(nameof(threelink.Position3d), revitThreelink, nameof(revitThreelink.Position)); threelink.Material = revitThreelink.Material; threelink.UpdatePropStatus(nameof(threelink.Material), revitThreelink, nameof(revitThreelink.Material)); threelink.Caliber = revitThreelink.Caliber; threelink.UpdatePropStatus(nameof(threelink.Caliber), revitThreelink, nameof(revitThreelink.Caliber)); threelink.RunningThroughLoss = revitThreelink.RunningThroughLoss; threelink.UpdatePropStatus(nameof(threelink.RunningThroughLoss), revitThreelink, nameof(revitThreelink.RunningThroughLoss)); threelink.BranchThroughLoss = revitThreelink.BranchThroughLoss; threelink.UpdatePropStatus(nameof(threelink.BranchThroughLoss), revitThreelink, nameof(revitThreelink.BranchThroughLoss)); if (allScenePropValueList == null) { allScenePropValueList = new List(); } var scenePropValueList = revitThreelink.PropValueList?.Select(x => new Yw.Model.HydroParterScenePropValueInfo() { Parter = revitThreelink.Id, Scene = HStation.Revit.ConstParas.Scene, PropName = x.PropName, PropValue = x.PropValue }).ToList(); if (scenePropValueList != null && scenePropValueList.Count > 0) { allScenePropValueList.AddRange(scenePropValueList); } return threelink; } //四通 private static Yw.Model.HydroFourlinkInfo FromRevit (HStation.Model.RevitFourlink revitFourlink, ref List allScenePropValueList) { if (revitFourlink == null) { return default; } var fourlink = new Yw.Model.HydroFourlinkInfo(); fourlink.Catalog = Yw.Hydro.ParterCatalog.Fourlink; fourlink.Name = revitFourlink.Name; fourlink.UpdatePropStatus(nameof(fourlink.Name), revitFourlink, nameof(revitFourlink.Name)); fourlink.Code = revitFourlink.Id; fourlink.UpdatePropStatus(nameof(fourlink.Code), revitFourlink, nameof(revitFourlink.Id)); fourlink.ModelType = revitFourlink.ModelType; fourlink.UpdatePropStatus(nameof(fourlink.ModelType), revitFourlink, nameof(revitFourlink.ModelType)); fourlink.Flags = revitFourlink.Flags; fourlink.UpdatePropStatus(nameof(fourlink.Flags), revitFourlink, nameof(revitFourlink.Flags)); fourlink.Description = revitFourlink.Description; fourlink.UpdatePropStatus(nameof(fourlink.Description), revitFourlink, nameof(revitFourlink.Description)); fourlink.FlowDirectionX = Yw.Hydro.FlowDirection.Positive; fourlink.UpdatePropStatus(nameof(fourlink.FlowDirectionX), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); fourlink.FlowDirectionY = Yw.Hydro.FlowDirection.Positive; fourlink.UpdatePropStatus(nameof(fourlink.FlowDirectionY), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); fourlink.Elev = revitFourlink.Elev; fourlink.UpdatePropStatus(nameof(fourlink.Elev), revitFourlink, nameof(revitFourlink.Elev)); fourlink.MinorLoss = revitFourlink.MinorLoss; fourlink.UpdatePropStatus(nameof(fourlink.MinorLoss), revitFourlink, nameof(revitFourlink.MinorLoss)); fourlink.Demand = revitFourlink.Demand; fourlink.UpdatePropStatus(nameof(fourlink.Demand), revitFourlink, nameof(revitFourlink.Demand)); fourlink.DemandPattern = revitFourlink.DemandPattern; fourlink.UpdatePropStatus(nameof(fourlink.DemandPattern), revitFourlink, nameof(revitFourlink.DemandPattern)); fourlink.Position2d = new Yw.Model.Hydro.Position2d(revitFourlink.Position.X, revitFourlink.Position.Y); fourlink.UpdatePropStatus(nameof(fourlink.Position2d), revitFourlink, nameof(revitFourlink.Position)); fourlink.Position3d = new Yw.Model.Hydro.Position3d(revitFourlink.Position.X, revitFourlink.Position.Y, revitFourlink.Position.Z); fourlink.UpdatePropStatus(nameof(fourlink.Position3d), revitFourlink, nameof(revitFourlink.Position)); fourlink.Material = revitFourlink.Material; fourlink.UpdatePropStatus(nameof(fourlink.Material), revitFourlink, nameof(revitFourlink.Material)); fourlink.Caliber = revitFourlink.Caliber; fourlink.UpdatePropStatus(nameof(fourlink.Caliber), revitFourlink, nameof(revitFourlink.Caliber)); if (allScenePropValueList == null) { allScenePropValueList = new List(); } var scenePropValueList = revitFourlink.PropValueList?.Select(x => new Yw.Model.HydroParterScenePropValueInfo() { Parter = revitFourlink.Id, Scene = HStation.Revit.ConstParas.Scene, PropName = x.PropName, PropValue = x.PropValue }).ToList(); if (scenePropValueList != null && scenePropValueList.Count > 0) { allScenePropValueList.AddRange(scenePropValueList); } return fourlink; } //喷嘴 private static Yw.Model.HydroNozzleInfo FromRevit (HStation.Model.RevitNozzle revitNozzle, ref List allScenePropValueList) { if (revitNozzle == null) { return default; } var nozzle = new Yw.Model.HydroNozzleInfo(); nozzle.Catalog = Yw.Hydro.ParterCatalog.Nozzle; nozzle.Name = revitNozzle.Name; nozzle.UpdatePropStatus(nameof(nozzle.Name), revitNozzle, nameof(revitNozzle.Name)); nozzle.Code = revitNozzle.Id; nozzle.UpdatePropStatus(nameof(nozzle.Code), revitNozzle, nameof(revitNozzle.Id)); nozzle.ModelType = revitNozzle.ModelType; nozzle.UpdatePropStatus(nameof(nozzle.ModelType), revitNozzle, nameof(revitNozzle.ModelType)); nozzle.Flags = revitNozzle.Flags; nozzle.UpdatePropStatus(nameof(nozzle.Flags), revitNozzle, nameof(revitNozzle.Flags)); nozzle.Description = revitNozzle.Description; nozzle.UpdatePropStatus(nameof(nozzle.Description), revitNozzle, nameof(revitNozzle.Description)); nozzle.FlowDirectionX = Yw.Hydro.FlowDirection.Positive; nozzle.UpdatePropStatus(nameof(nozzle.FlowDirectionX), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); nozzle.FlowDirectionY = Yw.Hydro.FlowDirection.Positive; nozzle.UpdatePropStatus(nameof(nozzle.FlowDirectionY), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); nozzle.Elev = revitNozzle.Elev; nozzle.UpdatePropStatus(nameof(nozzle.Elev), revitNozzle, nameof(revitNozzle.Elev)); nozzle.MinorLoss = revitNozzle.MinorLoss; nozzle.UpdatePropStatus(nameof(nozzle.MinorLoss), revitNozzle, nameof(revitNozzle.MinorLoss)); nozzle.Demand = revitNozzle.Demand; nozzle.UpdatePropStatus(nameof(nozzle.Demand), revitNozzle, nameof(revitNozzle.Demand)); nozzle.DemandPattern = revitNozzle.DemandPattern; nozzle.UpdatePropStatus(nameof(nozzle.DemandPattern), revitNozzle, nameof(revitNozzle.DemandPattern)); nozzle.Position2d = new Yw.Model.Hydro.Position2d(revitNozzle.Position.X, revitNozzle.Position.Y); nozzle.UpdatePropStatus(nameof(nozzle.Position2d), revitNozzle, nameof(revitNozzle.Position)); nozzle.Position3d = new Yw.Model.Hydro.Position3d(revitNozzle.Position.X, revitNozzle.Position.Y, revitNozzle.Position.Z); nozzle.UpdatePropStatus(nameof(nozzle.Position3d), revitNozzle, nameof(revitNozzle.Position)); nozzle.Material = revitNozzle.Material; nozzle.UpdatePropStatus(nameof(nozzle.Material), revitNozzle, nameof(revitNozzle.Material)); nozzle.Caliber = revitNozzle.Caliber; nozzle.UpdatePropStatus(nameof(nozzle.Caliber), revitNozzle, nameof(revitNozzle.Caliber)); nozzle.Coefficient = revitNozzle.Coefficient; nozzle.UpdatePropStatus(nameof(nozzle.Coefficient), revitNozzle, nameof(revitNozzle.Coefficient)); if (allScenePropValueList == null) { allScenePropValueList = new List(); } var scenePropValueList = revitNozzle.PropValueList?.Select(x => new Yw.Model.HydroParterScenePropValueInfo() { Parter = revitNozzle.Id, Scene = HStation.Revit.ConstParas.Scene, PropName = x.PropName, PropValue = x.PropValue }).ToList(); if (scenePropValueList != null && scenePropValueList.Count > 0) { allScenePropValueList.AddRange(scenePropValueList); } return nozzle; } //消火栓 private static Yw.Model.HydroHydrantInfo FromRevit (HStation.Model.RevitHydrant revitHydrant, ref List allScenePropValueList) { if (revitHydrant == null) { return default; } var hydrant = new Yw.Model.HydroHydrantInfo(); hydrant.Catalog = Yw.Hydro.ParterCatalog.Hydrant; hydrant.Name = revitHydrant.Name; hydrant.UpdatePropStatus(nameof(hydrant.Name), revitHydrant, nameof(revitHydrant.Name)); hydrant.Code = revitHydrant.Id; hydrant.UpdatePropStatus(nameof(hydrant.Code), revitHydrant, nameof(revitHydrant.Id)); hydrant.ModelType = revitHydrant.ModelType; hydrant.UpdatePropStatus(nameof(hydrant.ModelType), revitHydrant, nameof(revitHydrant.ModelType)); hydrant.Flags = revitHydrant.Flags; hydrant.UpdatePropStatus(nameof(hydrant.Flags), revitHydrant, nameof(revitHydrant.Flags)); hydrant.Description = revitHydrant.Description; hydrant.UpdatePropStatus(nameof(hydrant.Description), revitHydrant, nameof(revitHydrant.Description)); hydrant.FlowDirectionX = Yw.Hydro.FlowDirection.Positive; hydrant.UpdatePropStatus(nameof(hydrant.FlowDirectionX), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); hydrant.FlowDirectionY = Yw.Hydro.FlowDirection.Positive; hydrant.UpdatePropStatus(nameof(hydrant.FlowDirectionY), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); hydrant.Elev = revitHydrant.Elev; hydrant.UpdatePropStatus(nameof(hydrant.Elev), revitHydrant, nameof(revitHydrant.Elev)); hydrant.MinorLoss = revitHydrant.MinorLoss; hydrant.UpdatePropStatus(nameof(hydrant.MinorLoss), revitHydrant, nameof(revitHydrant.MinorLoss)); hydrant.Demand = revitHydrant.Demand; hydrant.UpdatePropStatus(nameof(hydrant.Demand), revitHydrant, nameof(revitHydrant.Demand)); hydrant.DemandPattern = revitHydrant.DemandPattern; hydrant.UpdatePropStatus(nameof(hydrant.DemandPattern), revitHydrant, nameof(revitHydrant.DemandPattern)); hydrant.Position2d = new Yw.Model.Hydro.Position2d(revitHydrant.Position.X, revitHydrant.Position.Y); hydrant.UpdatePropStatus(nameof(hydrant.Position2d), revitHydrant, nameof(revitHydrant.Position)); hydrant.Position3d = new Yw.Model.Hydro.Position3d(revitHydrant.Position.X, revitHydrant.Position.Y, revitHydrant.Position.Z); hydrant.UpdatePropStatus(nameof(hydrant.Position3d), revitHydrant, nameof(revitHydrant.Position)); hydrant.Material = revitHydrant.Material; hydrant.UpdatePropStatus(nameof(hydrant.Material), revitHydrant, nameof(revitHydrant.Material)); hydrant.Caliber = revitHydrant.Caliber; hydrant.UpdatePropStatus(nameof(hydrant.Caliber), revitHydrant, nameof(revitHydrant.Caliber)); hydrant.Coefficient = revitHydrant.Coefficient; hydrant.UpdatePropStatus(nameof(hydrant.Coefficient), revitHydrant, nameof(revitHydrant.Coefficient)); if (allScenePropValueList == null) { allScenePropValueList = new List(); } var scenePropValueList = revitHydrant.PropValueList?.Select(x => new Yw.Model.HydroParterScenePropValueInfo() { Parter = revitHydrant.Id, Scene = HStation.Revit.ConstParas.Scene, PropName = x.PropName, PropValue = x.PropValue }).ToList(); if (scenePropValueList != null && scenePropValueList.Count > 0) { allScenePropValueList.AddRange(scenePropValueList); } return hydrant; } //冷却塔 private static Yw.Model.HydroCoolingInfo FromRevit (HStation.Model.RevitCooling revitCooling, ref List allScenePropValueList) { if (revitCooling == null) { return default; } var cooling = new Yw.Model.HydroCoolingInfo(); cooling.Catalog = Yw.Hydro.ParterCatalog.Cooling; cooling.Name = revitCooling.Name; cooling.UpdatePropStatus(nameof(cooling.Name), revitCooling, nameof(revitCooling.Name)); cooling.Code = revitCooling.Id; cooling.UpdatePropStatus(nameof(cooling.Code), revitCooling, nameof(revitCooling.Id)); cooling.ModelType = revitCooling.ModelType; cooling.UpdatePropStatus(nameof(cooling.ModelType), revitCooling, nameof(revitCooling.ModelType)); cooling.Flags = revitCooling.Flags; cooling.UpdatePropStatus(nameof(cooling.Flags), revitCooling, nameof(revitCooling.Flags)); cooling.Description = revitCooling.Description; cooling.UpdatePropStatus(nameof(cooling.Description), revitCooling, nameof(revitCooling.Description)); cooling.FlowDirectionX = Yw.Hydro.FlowDirection.Positive; cooling.UpdatePropStatus(nameof(cooling.FlowDirectionX), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); cooling.FlowDirectionY = Yw.Hydro.FlowDirection.Positive; cooling.UpdatePropStatus(nameof(cooling.FlowDirectionY), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); cooling.Elev = revitCooling.Elev; cooling.UpdatePropStatus(nameof(cooling.Elev), revitCooling, nameof(revitCooling.Elev)); cooling.MinorLoss = revitCooling.MinorLoss; cooling.UpdatePropStatus(nameof(cooling.MinorLoss), revitCooling, nameof(revitCooling.MinorLoss)); cooling.Demand = revitCooling.Demand; cooling.UpdatePropStatus(nameof(cooling.Demand), revitCooling, nameof(revitCooling.Demand)); cooling.DemandPattern = revitCooling.DemandPattern; cooling.UpdatePropStatus(nameof(cooling.DemandPattern), revitCooling, nameof(revitCooling.DemandPattern)); cooling.Position2d = new Yw.Model.Hydro.Position2d(revitCooling.Position.X, revitCooling.Position.Y); cooling.UpdatePropStatus(nameof(cooling.Position2d), revitCooling, nameof(revitCooling.Position)); cooling.Position3d = new Yw.Model.Hydro.Position3d(revitCooling.Position.X, revitCooling.Position.Y, revitCooling.Position.Z); cooling.UpdatePropStatus(nameof(cooling.Position3d), revitCooling, nameof(revitCooling.Position)); cooling.Material = revitCooling.Material; cooling.UpdatePropStatus(nameof(cooling.Material), revitCooling, nameof(revitCooling.Material)); cooling.Caliber = revitCooling.Caliber; cooling.UpdatePropStatus(nameof(cooling.Caliber), revitCooling, nameof(revitCooling.Caliber)); cooling.Coefficient = revitCooling.Coefficient; cooling.UpdatePropStatus(nameof(cooling.Coefficient), revitCooling, nameof(revitCooling.Coefficient)); cooling.LowerLimit = revitCooling.LowerLimit; cooling.UpdatePropStatus(nameof(cooling.LowerLimit), revitCooling, nameof(revitCooling.LowerLimit)); if (allScenePropValueList == null) { allScenePropValueList = new List(); } var scenePropValueList = revitCooling.PropValueList?.Select(x => new Yw.Model.HydroParterScenePropValueInfo() { Parter = revitCooling.Id, Scene = HStation.Revit.ConstParas.Scene, PropName = x.PropName, PropValue = x.PropValue }).ToList(); if (scenePropValueList != null && scenePropValueList.Count > 0) { allScenePropValueList.AddRange(scenePropValueList); } return cooling; } //水表 private static Yw.Model.HydroMeterInfo FromRevit (HStation.Model.RevitMeter revitMeter, ref List allScenePropValueList) { if (revitMeter == null) { return default; } var meter = new Yw.Model.HydroMeterInfo(); meter.Catalog = Yw.Hydro.ParterCatalog.Meter; meter.Name = revitMeter.Name; meter.UpdatePropStatus(nameof(meter.Name), revitMeter, nameof(revitMeter.Name)); meter.Code = revitMeter.Id; meter.UpdatePropStatus(nameof(meter.Code), revitMeter, nameof(revitMeter.Id)); meter.ModelType = revitMeter.ModelType; meter.UpdatePropStatus(nameof(meter.ModelType), revitMeter, nameof(revitMeter.ModelType)); meter.Flags = revitMeter.Flags; meter.UpdatePropStatus(nameof(meter.Flags), revitMeter, nameof(revitMeter.Flags)); meter.Description = revitMeter.Description; meter.UpdatePropStatus(nameof(meter.Description), revitMeter, nameof(revitMeter.Description)); meter.FlowDirectionX = Yw.Hydro.FlowDirection.Positive; meter.UpdatePropStatus(nameof(meter.FlowDirectionX), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); meter.FlowDirectionY = Yw.Hydro.FlowDirection.Positive; meter.UpdatePropStatus(nameof(meter.FlowDirectionY), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); meter.Elev = revitMeter.Elev; meter.UpdatePropStatus(nameof(meter.Elev), revitMeter, nameof(revitMeter.Elev)); meter.MinorLoss = revitMeter.MinorLoss; meter.UpdatePropStatus(nameof(meter.MinorLoss), revitMeter, nameof(revitMeter.MinorLoss)); meter.Demand = revitMeter.Demand; meter.UpdatePropStatus(nameof(meter.Demand), revitMeter, nameof(revitMeter.Demand)); meter.DemandPattern = revitMeter.DemandPattern; meter.UpdatePropStatus(nameof(meter.DemandPattern), revitMeter, nameof(revitMeter.DemandPattern)); meter.Position2d = new Yw.Model.Hydro.Position2d(revitMeter.Position.X, revitMeter.Position.Y); meter.UpdatePropStatus(nameof(meter.Position2d), revitMeter, nameof(revitMeter.Position)); meter.Position3d = new Yw.Model.Hydro.Position3d(revitMeter.Position.X, revitMeter.Position.Y, revitMeter.Position.Z); meter.UpdatePropStatus(nameof(meter.Position3d), revitMeter, nameof(revitMeter.Position)); if (allScenePropValueList == null) { allScenePropValueList = new List(); } var scenePropValueList = revitMeter.PropValueList?.Select(x => new Yw.Model.HydroParterScenePropValueInfo() { Parter = revitMeter.Id, Scene = HStation.Revit.ConstParas.Scene, PropName = x.PropName, PropValue = x.PropValue }).ToList(); if (scenePropValueList != null && scenePropValueList.Count > 0) { allScenePropValueList.AddRange(scenePropValueList); } return meter; } //流量计 private static Yw.Model.HydroFlowmeterInfo FromRevit (HStation.Model.RevitFlowmeter revitFlowmeter, ref List allScenePropValueList) { if (revitFlowmeter == null) { return default; } var flowmeter = new Yw.Model.HydroFlowmeterInfo(); flowmeter.Catalog = Yw.Hydro.ParterCatalog.Flowmeter; flowmeter.Name = revitFlowmeter.Name; flowmeter.UpdatePropStatus(nameof(flowmeter.Name), revitFlowmeter, nameof(revitFlowmeter.Name)); flowmeter.Code = revitFlowmeter.Id; flowmeter.UpdatePropStatus(nameof(flowmeter.Code), revitFlowmeter, nameof(revitFlowmeter.Id)); flowmeter.ModelType = revitFlowmeter.ModelType; flowmeter.UpdatePropStatus(nameof(flowmeter.ModelType), revitFlowmeter, nameof(revitFlowmeter.ModelType)); flowmeter.Flags = revitFlowmeter.Flags; flowmeter.UpdatePropStatus(nameof(flowmeter.Flags), revitFlowmeter, nameof(revitFlowmeter.Flags)); flowmeter.Description = revitFlowmeter.Description; flowmeter.UpdatePropStatus(nameof(flowmeter.Description), revitFlowmeter, nameof(revitFlowmeter.Description)); flowmeter.FlowDirectionX = Yw.Hydro.FlowDirection.Positive; flowmeter.UpdatePropStatus(nameof(flowmeter.FlowDirectionX), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); flowmeter.FlowDirectionY = Yw.Hydro.FlowDirection.Positive; flowmeter.UpdatePropStatus(nameof(flowmeter.FlowDirectionY), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); flowmeter.Elev = revitFlowmeter.Elev; flowmeter.UpdatePropStatus(nameof(flowmeter.Elev), revitFlowmeter, nameof(revitFlowmeter.Elev)); flowmeter.MinorLoss = revitFlowmeter.MinorLoss; flowmeter.UpdatePropStatus(nameof(flowmeter.MinorLoss), revitFlowmeter, nameof(revitFlowmeter.MinorLoss)); flowmeter.Demand = revitFlowmeter.Demand; flowmeter.UpdatePropStatus(nameof(flowmeter.Demand), revitFlowmeter, nameof(revitFlowmeter.Demand)); flowmeter.DemandPattern = revitFlowmeter.DemandPattern; flowmeter.UpdatePropStatus(nameof(flowmeter.DemandPattern), revitFlowmeter, nameof(revitFlowmeter.DemandPattern)); flowmeter.Position2d = new Yw.Model.Hydro.Position2d(revitFlowmeter.Position.X, revitFlowmeter.Position.Y); flowmeter.UpdatePropStatus(nameof(flowmeter.Position2d), revitFlowmeter, nameof(revitFlowmeter.Position)); flowmeter.Position3d = new Yw.Model.Hydro.Position3d(revitFlowmeter.Position.X, revitFlowmeter.Position.Y, revitFlowmeter.Position.Z); flowmeter.UpdatePropStatus(nameof(flowmeter.Position3d), revitFlowmeter, nameof(revitFlowmeter.Position)); if (allScenePropValueList == null) { allScenePropValueList = new List(); } var scenePropValueList = revitFlowmeter.PropValueList?.Select(x => new Yw.Model.HydroParterScenePropValueInfo() { Parter = revitFlowmeter.Id, Scene = HStation.Revit.ConstParas.Scene, PropName = x.PropName, PropValue = x.PropValue }).ToList(); if (scenePropValueList != null && scenePropValueList.Count > 0) { allScenePropValueList.AddRange(scenePropValueList); } return flowmeter; } //压力表 private static Yw.Model.HydroPressmeterInfo FromRevit (HStation.Model.RevitPressmeter revitPressmeter, ref List allScenePropValueList) { if (revitPressmeter == null) { return default; } var pressmeter = new Yw.Model.HydroPressmeterInfo(); pressmeter.Catalog = Yw.Hydro.ParterCatalog.Pressmeter; pressmeter.Name = revitPressmeter.Name; pressmeter.UpdatePropStatus(nameof(pressmeter.Name), revitPressmeter, nameof(revitPressmeter.Name)); pressmeter.Code = revitPressmeter.Id; pressmeter.UpdatePropStatus(nameof(pressmeter.Code), revitPressmeter, nameof(revitPressmeter.Id)); pressmeter.ModelType = revitPressmeter.ModelType; pressmeter.UpdatePropStatus(nameof(pressmeter.ModelType), revitPressmeter, nameof(revitPressmeter.ModelType)); pressmeter.Flags = revitPressmeter.Flags; pressmeter.UpdatePropStatus(nameof(pressmeter.Flags), revitPressmeter, nameof(revitPressmeter.Flags)); pressmeter.Description = revitPressmeter.Description; pressmeter.UpdatePropStatus(nameof(pressmeter.Description), revitPressmeter, nameof(revitPressmeter.Description)); pressmeter.FlowDirectionX = Yw.Hydro.FlowDirection.Positive; pressmeter.UpdatePropStatus(nameof(pressmeter.FlowDirectionX), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); pressmeter.FlowDirectionY = Yw.Hydro.FlowDirection.Positive; pressmeter.UpdatePropStatus(nameof(pressmeter.FlowDirectionY), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); pressmeter.Elev = revitPressmeter.Elev; pressmeter.UpdatePropStatus(nameof(pressmeter.Elev), revitPressmeter, nameof(revitPressmeter.Elev)); pressmeter.MinorLoss = revitPressmeter.MinorLoss; pressmeter.UpdatePropStatus(nameof(pressmeter.MinorLoss), revitPressmeter, nameof(revitPressmeter.MinorLoss)); pressmeter.Demand = revitPressmeter.Demand; pressmeter.UpdatePropStatus(nameof(pressmeter.Demand), revitPressmeter, nameof(revitPressmeter.Demand)); pressmeter.DemandPattern = revitPressmeter.DemandPattern; pressmeter.UpdatePropStatus(nameof(pressmeter.DemandPattern), revitPressmeter, nameof(revitPressmeter.DemandPattern)); pressmeter.Position2d = new Yw.Model.Hydro.Position2d(revitPressmeter.Position.X, revitPressmeter.Position.Y); pressmeter.UpdatePropStatus(nameof(pressmeter.Position2d), revitPressmeter, nameof(revitPressmeter.Position)); pressmeter.Position3d = new Yw.Model.Hydro.Position3d(revitPressmeter.Position.X, revitPressmeter.Position.Y, revitPressmeter.Position.Z); pressmeter.UpdatePropStatus(nameof(pressmeter.Position3d), revitPressmeter, nameof(revitPressmeter.Position)); if (allScenePropValueList == null) { allScenePropValueList = new List(); } var scenePropValueList = revitPressmeter.PropValueList?.Select(x => new Yw.Model.HydroParterScenePropValueInfo() { Parter = revitPressmeter.Id, Scene = HStation.Revit.ConstParas.Scene, PropName = x.PropName, PropValue = x.PropValue }).ToList(); if (scenePropValueList != null && scenePropValueList.Count > 0) { allScenePropValueList.AddRange(scenePropValueList); } return pressmeter; } //管道 private static Yw.Model.HydroPipeInfo FromRevit (HStation.Model.RevitPipe revitPipe, ref List allScenePropValueList) { if (revitPipe == null) { return default; } var pipe = new Yw.Model.HydroPipeInfo(); pipe.Catalog = Yw.Hydro.ParterCatalog.Pipe; pipe.Name = revitPipe.Name; pipe.UpdatePropStatus(nameof(pipe.Name), revitPipe, nameof(revitPipe.Name)); pipe.Code = revitPipe.Id; pipe.UpdatePropStatus(nameof(pipe.Code), revitPipe, nameof(revitPipe.Id)); pipe.ModelType = revitPipe.ModelType; pipe.UpdatePropStatus(nameof(pipe.ModelType), revitPipe, nameof(revitPipe.ModelType)); pipe.Flags = revitPipe.Flags; pipe.UpdatePropStatus(nameof(pipe.Flags), revitPipe, nameof(revitPipe.Flags)); pipe.Description = revitPipe.Description; pipe.UpdatePropStatus(nameof(pipe.Description), revitPipe, nameof(revitPipe.Description)); pipe.FlowDirectionX = Yw.Hydro.FlowDirection.Positive; pipe.UpdatePropStatus(nameof(pipe.FlowDirectionX), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); pipe.FlowDirectionY = Yw.Hydro.FlowDirection.Positive; pipe.UpdatePropStatus(nameof(pipe.FlowDirectionY), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); pipe.StartCode = revitPipe.StartCode; pipe.UpdatePropStatus(nameof(pipe.StartCode), revitPipe, nameof(revitPipe.StartCode)); pipe.EndCode = revitPipe.EndCode; pipe.UpdatePropStatus(nameof(pipe.EndCode), revitPipe, nameof(revitPipe.EndCode)); pipe.LinkStatus = revitPipe.LinkStatus; pipe.UpdatePropStatus(nameof(pipe.LinkStatus), revitPipe, nameof(revitPipe.LinkStatus)); pipe.Material = revitPipe.Material; pipe.UpdatePropStatus(nameof(pipe.Material), revitPipe, nameof(revitPipe.Material)); pipe.Diameter = revitPipe.Diameter; pipe.UpdatePropStatus(nameof(pipe.Diameter), revitPipe, nameof(revitPipe.Diameter)); pipe.Length = revitPipe.Length; pipe.UpdatePropStatus(nameof(pipe.Length), revitPipe, nameof(revitPipe.Length)); pipe.Roughness = revitPipe.Roughness; pipe.UpdatePropStatus(nameof(pipe.Roughness), revitPipe, nameof(revitPipe.Roughness)); pipe.MinorLoss = revitPipe.MinorLoss; pipe.UpdatePropStatus(nameof(pipe.MinorLoss), revitPipe, nameof(revitPipe.MinorLoss)); if (allScenePropValueList == null) { allScenePropValueList = new List(); } var scenePropValueList = revitPipe.PropValueList?.Select(x => new Yw.Model.HydroParterScenePropValueInfo() { Parter = revitPipe.Id, Scene = HStation.Revit.ConstParas.Scene, PropName = x.PropName, PropValue = x.PropValue }).ToList(); if (scenePropValueList != null && scenePropValueList.Count > 0) { allScenePropValueList.AddRange(scenePropValueList); } return pipe; } //过渡件 private static Yw.Model.HydroTranslationInfo FromRevit (HStation.Model.RevitTranslation revitTranslation, ref List allScenePropValueList) { if (revitTranslation == null) { return default; } var translation = new Yw.Model.HydroTranslationInfo(); translation.Catalog = Yw.Hydro.ParterCatalog.Translation; translation.Name = revitTranslation.Name; translation.UpdatePropStatus(nameof(translation.Name), revitTranslation, nameof(revitTranslation.Name)); translation.Code = revitTranslation.Id; translation.UpdatePropStatus(nameof(translation.Code), revitTranslation, nameof(revitTranslation.Id)); translation.ModelType = revitTranslation.ModelType; translation.UpdatePropStatus(nameof(translation.ModelType), revitTranslation, nameof(revitTranslation.ModelType)); translation.Flags = revitTranslation.Flags; translation.UpdatePropStatus(nameof(translation.Flags), revitTranslation, nameof(revitTranslation.Flags)); translation.Description = revitTranslation.Description; translation.UpdatePropStatus(nameof(translation.Description), revitTranslation, nameof(revitTranslation.Description)); translation.FlowDirectionX = Yw.Hydro.FlowDirection.Positive; translation.UpdatePropStatus(nameof(translation.FlowDirectionX), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); translation.FlowDirectionY = Yw.Hydro.FlowDirection.Positive; translation.UpdatePropStatus(nameof(translation.FlowDirectionY), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); translation.StartCode = revitTranslation.StartCode; translation.UpdatePropStatus(nameof(translation.StartCode), revitTranslation, nameof(revitTranslation.StartCode)); translation.EndCode = revitTranslation.EndCode; translation.UpdatePropStatus(nameof(translation.EndCode), revitTranslation, nameof(revitTranslation.EndCode)); translation.LinkStatus = revitTranslation.LinkStatus; translation.UpdatePropStatus(nameof(translation.LinkStatus), revitTranslation, nameof(revitTranslation.LinkStatus)); translation.Material = revitTranslation.Material; translation.UpdatePropStatus(nameof(translation.Material), revitTranslation, nameof(revitTranslation.Material)); translation.Diameter = revitTranslation.Diameter; translation.UpdatePropStatus(nameof(translation.Diameter), revitTranslation, nameof(revitTranslation.Diameter)); translation.StartDiameter = revitTranslation.StartDiameter; translation.UpdatePropStatus(nameof(translation.StartDiameter), revitTranslation, nameof(revitTranslation.StartDiameter)); translation.EndDiameter = revitTranslation.EndDiameter; translation.UpdatePropStatus(nameof(translation.EndDiameter), revitTranslation, nameof(revitTranslation.EndDiameter)); translation.Length = revitTranslation.Length; translation.UpdatePropStatus(nameof(translation.Length), revitTranslation, nameof(revitTranslation.Length)); translation.Roughness = revitTranslation.Roughness; translation.UpdatePropStatus(nameof(translation.Roughness), revitTranslation, nameof(revitTranslation.Roughness)); translation.MinorLoss = revitTranslation.MinorLoss; translation.UpdatePropStatus(nameof(translation.MinorLoss), revitTranslation, nameof(revitTranslation.MinorLoss)); if (allScenePropValueList == null) { allScenePropValueList = new List(); } var scenePropValueList = revitTranslation.PropValueList?.Select(x => new Yw.Model.HydroParterScenePropValueInfo() { Parter = revitTranslation.Id, Scene = HStation.Revit.ConstParas.Scene, PropName = x.PropName, PropValue = x.PropValue }).ToList(); if (scenePropValueList != null && scenePropValueList.Count > 0) { allScenePropValueList.AddRange(scenePropValueList); } return translation; } //水泵 private static Yw.Model.HydroPumpInfo FromRevit (HStation.Model.RevitPump revitPump, ref List allScenePropValueList) { if (revitPump == null) { return default; } var pump = new Yw.Model.HydroPumpInfo(); pump.Catalog = Yw.Hydro.ParterCatalog.Pump; pump.Name = revitPump.Name; pump.UpdatePropStatus(nameof(pump.Name), revitPump, nameof(revitPump.Name)); pump.Code = revitPump.Id; pump.UpdatePropStatus(nameof(pump.Code), revitPump, nameof(revitPump.Id)); pump.ModelType = revitPump.ModelType; pump.UpdatePropStatus(nameof(pump.ModelType), revitPump, nameof(revitPump.ModelType)); pump.Flags = revitPump.Flags; pump.UpdatePropStatus(nameof(pump.Flags), revitPump, nameof(revitPump.Flags)); pump.Description = revitPump.Description; pump.UpdatePropStatus(nameof(pump.Description), revitPump, nameof(revitPump.Description)); pump.FlowDirectionX = Yw.Hydro.FlowDirection.Positive; pump.UpdatePropStatus(nameof(pump.FlowDirectionX), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); pump.FlowDirectionY = Yw.Hydro.FlowDirection.Positive; pump.UpdatePropStatus(nameof(pump.FlowDirectionY), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); pump.StartCode = revitPump.StartCode; pump.UpdatePropStatus(nameof(pump.StartCode), revitPump, nameof(revitPump.StartCode)); pump.EndCode = revitPump.EndCode; pump.UpdatePropStatus(nameof(pump.EndCode), revitPump, nameof(revitPump.EndCode)); pump.LinkStatus = revitPump.LinkStatus; pump.UpdatePropStatus(nameof(pump.LinkStatus), revitPump, nameof(revitPump.LinkStatus)); pump.RatedQ = revitPump.RatedQ; pump.UpdatePropStatus(nameof(pump.RatedQ), revitPump, nameof(revitPump.RatedQ)); pump.RatedH = revitPump.RatedH; pump.UpdatePropStatus(nameof(pump.RatedH), revitPump, nameof(revitPump.RatedH)); pump.RatedP = revitPump.RatedP; pump.UpdatePropStatus(nameof(pump.RatedP), revitPump, nameof(revitPump.RatedP)); pump.RatedN = revitPump.RatedN; pump.UpdatePropStatus(nameof(pump.RatedN), revitPump, nameof(revitPump.RatedN)); pump.RatedHz = revitPump.RatedHz; pump.UpdatePropStatus(nameof(pump.RatedHz), revitPump, nameof(revitPump.RatedHz)); pump.SpeedRatio = revitPump.SpeedRatio; pump.UpdatePropStatus(nameof(pump.SpeedRatio), revitPump, nameof(revitPump.SpeedRatio)); pump.SpeedRatioPattern = revitPump.SpeedRatioPattern; pump.UpdatePropStatus(nameof(pump.SpeedRatioPattern), revitPump, nameof(revitPump.SpeedRatioPattern)); pump.CurveQH = revitPump.CurveQH; pump.UpdatePropStatus(nameof(pump.CurveQH), revitPump, nameof(revitPump.CurveQH)); pump.CurveQP = revitPump.CurveQP; pump.UpdatePropStatus(nameof(pump.CurveQP), revitPump, nameof(revitPump.CurveQP)); pump.CurveQE = revitPump.CurveQE; pump.UpdatePropStatus(nameof(pump.CurveQE), revitPump, nameof(revitPump.CurveQE)); if (allScenePropValueList == null) { allScenePropValueList = new List(); } var scenePropValueList = revitPump.PropValueList?.Select(x => new Yw.Model.HydroParterScenePropValueInfo() { Parter = revitPump.Id, Scene = HStation.Revit.ConstParas.Scene, PropName = x.PropName, PropValue = x.PropValue }).ToList(); if (scenePropValueList != null && scenePropValueList.Count > 0) { allScenePropValueList.AddRange(scenePropValueList); } return pump; } //阀门 private static Yw.Model.HydroValveInfo FromRevit (HStation.Model.RevitValve revitValve, ref List allScenePropValueList) { if (revitValve == null) { return default; } var valve = new Yw.Model.HydroValveInfo(); valve.Catalog = Yw.Hydro.ParterCatalog.Valve; valve.Name = revitValve.Name; valve.UpdatePropStatus(nameof(valve.Name), revitValve, nameof(revitValve.Name)); valve.Code = revitValve.Id; valve.UpdatePropStatus(nameof(valve.Code), revitValve, nameof(revitValve.Id)); valve.ModelType = revitValve.ModelType; valve.UpdatePropStatus(nameof(valve.ModelType), revitValve, nameof(revitValve.ModelType)); valve.Flags = revitValve.Flags; valve.UpdatePropStatus(nameof(valve.Flags), revitValve, nameof(revitValve.Flags)); valve.Description = revitValve.Description; valve.UpdatePropStatus(nameof(valve.Description), revitValve, nameof(revitValve.Description)); valve.FlowDirectionX = Yw.Hydro.FlowDirection.Positive; valve.UpdatePropStatus(nameof(valve.FlowDirectionX), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); valve.FlowDirectionY = Yw.Hydro.FlowDirection.Positive; valve.UpdatePropStatus(nameof(valve.FlowDirectionY), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); valve.StartCode = revitValve.StartCode; valve.UpdatePropStatus(nameof(valve.StartCode), revitValve, nameof(revitValve.StartCode)); valve.EndCode = revitValve.EndCode; valve.UpdatePropStatus(nameof(valve.EndCode), revitValve, nameof(revitValve.EndCode)); valve.LinkStatus = revitValve.LinkStatus; valve.UpdatePropStatus(nameof(valve.LinkStatus), revitValve, nameof(revitValve.LinkStatus)); valve.Material = revitValve.Material; valve.UpdatePropStatus(nameof(valve.Material), revitValve, nameof(revitValve.Material)); valve.Diameter = revitValve.Diameter; valve.UpdatePropStatus(nameof(valve.Diameter), revitValve, nameof(revitValve.Diameter)); valve.MinorLoss = revitValve.MinorLoss; valve.UpdatePropStatus(nameof(valve.MinorLoss), revitValve, nameof(revitValve.MinorLoss)); valve.ValveType = revitValve.ValveType; valve.UpdatePropStatus(nameof(valve.ValveType), revitValve, nameof(revitValve.ValveType)); valve.OpeningDegree = revitValve.OpeningDegree; valve.UpdatePropStatus(nameof(valve.OpeningDegree), revitValve, nameof(revitValve.OpeningDegree)); valve.ValveSetting = revitValve.ValveSetting; valve.UpdatePropStatus(nameof(valve.ValveSetting), revitValve, nameof(revitValve.ValveSetting)); if (allScenePropValueList == null) { allScenePropValueList = new List(); } var scenePropValueList = revitValve.PropValueList?.Select(x => new Yw.Model.HydroParterScenePropValueInfo() { Parter = revitValve.Id, Scene = HStation.Revit.ConstParas.Scene, PropName = x.PropName, PropValue = x.PropValue }).ToList(); if (scenePropValueList != null && scenePropValueList.Count > 0) { allScenePropValueList.AddRange(scenePropValueList); } return valve; } //换热器 private static Yw.Model.HydroExchangerInfo FromRevit (HStation.Model.RevitExchanger revitExchanger, ref List allScenePropValueList) { if (revitExchanger == null) { return default; } var exchanger = new Yw.Model.HydroExchangerInfo(); exchanger.Catalog = Yw.Hydro.ParterCatalog.Exchanger; exchanger.Name = revitExchanger.Name; exchanger.UpdatePropStatus(nameof(exchanger.Name), revitExchanger, nameof(revitExchanger.Name)); exchanger.Code = revitExchanger.Id; exchanger.UpdatePropStatus(nameof(exchanger.Code), revitExchanger, nameof(revitExchanger.Id)); exchanger.ModelType = revitExchanger.ModelType; exchanger.UpdatePropStatus(nameof(exchanger.ModelType), revitExchanger, nameof(revitExchanger.ModelType)); exchanger.Flags = revitExchanger.Flags; exchanger.UpdatePropStatus(nameof(exchanger.Flags), revitExchanger, nameof(revitExchanger.Flags)); exchanger.Description = revitExchanger.Description; exchanger.UpdatePropStatus(nameof(exchanger.Description), revitExchanger, nameof(revitExchanger.Description)); exchanger.FlowDirectionX = Yw.Hydro.FlowDirection.Positive; exchanger.UpdatePropStatus(nameof(exchanger.FlowDirectionX), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); exchanger.FlowDirectionY = Yw.Hydro.FlowDirection.Positive; exchanger.UpdatePropStatus(nameof(exchanger.FlowDirectionY), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); exchanger.StartCode = revitExchanger.StartCode; exchanger.UpdatePropStatus(nameof(exchanger.StartCode), revitExchanger, nameof(revitExchanger.StartCode)); exchanger.EndCode = revitExchanger.EndCode; exchanger.UpdatePropStatus(nameof(exchanger.EndCode), revitExchanger, nameof(revitExchanger.EndCode)); exchanger.LinkStatus = revitExchanger.LinkStatus; exchanger.UpdatePropStatus(nameof(exchanger.LinkStatus), revitExchanger, nameof(revitExchanger.LinkStatus)); exchanger.Material = revitExchanger.Material; exchanger.UpdatePropStatus(nameof(exchanger.Material), revitExchanger, nameof(revitExchanger.Material)); exchanger.Diameter = revitExchanger.Diameter; exchanger.UpdatePropStatus(nameof(exchanger.Diameter), revitExchanger, nameof(revitExchanger.Diameter)); exchanger.MinorLoss = revitExchanger.MinorLoss; exchanger.UpdatePropStatus(nameof(exchanger.MinorLoss), revitExchanger, nameof(revitExchanger.MinorLoss)); exchanger.CurveQL = revitExchanger.CurveQL; exchanger.UpdatePropStatus(nameof(exchanger.CurveQL), revitExchanger, nameof(revitExchanger.CurveQL)); if (allScenePropValueList == null) { allScenePropValueList = new List(); } var scenePropValueList = revitExchanger.PropValueList?.Select(x => new Yw.Model.HydroParterScenePropValueInfo() { Parter = revitExchanger.Id, Scene = HStation.Revit.ConstParas.Scene, PropName = x.PropName, PropValue = x.PropValue }).ToList(); if (scenePropValueList != null && scenePropValueList.Count > 0) { allScenePropValueList.AddRange(scenePropValueList); } return exchanger; } //空压机 private static Yw.Model.HydroCompressorInfo FromRevit (HStation.Model.RevitCompressor revitCompressor, ref List allScenePropValueList) { if (revitCompressor == null) { return default; } var compressor = new Yw.Model.HydroCompressorInfo(); compressor.Catalog = Yw.Hydro.ParterCatalog.Compressor; compressor.Name = revitCompressor.Name; compressor.UpdatePropStatus(nameof(compressor.Name), revitCompressor, nameof(revitCompressor.Name)); compressor.Code = revitCompressor.Id; compressor.UpdatePropStatus(nameof(compressor.Code), revitCompressor, nameof(revitCompressor.Id)); compressor.ModelType = revitCompressor.ModelType; compressor.UpdatePropStatus(nameof(compressor.ModelType), revitCompressor, nameof(revitCompressor.ModelType)); compressor.Flags = revitCompressor.Flags; compressor.UpdatePropStatus(nameof(compressor.Flags), revitCompressor, nameof(revitCompressor.Flags)); compressor.Description = revitCompressor.Description; compressor.UpdatePropStatus(nameof(compressor.Description), revitCompressor, nameof(revitCompressor.Description)); compressor.FlowDirectionX = Yw.Hydro.FlowDirection.Positive; compressor.UpdatePropStatus(nameof(compressor.FlowDirectionX), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); compressor.FlowDirectionY = Yw.Hydro.FlowDirection.Positive; compressor.UpdatePropStatus(nameof(compressor.FlowDirectionY), Yw.Hydro.ePropStatus.Lack, "缺省,自动修正"); compressor.StartCode = revitCompressor.StartCode; compressor.UpdatePropStatus(nameof(compressor.StartCode), revitCompressor, nameof(revitCompressor.StartCode)); compressor.EndCode = revitCompressor.EndCode; compressor.UpdatePropStatus(nameof(compressor.EndCode), revitCompressor, nameof(revitCompressor.EndCode)); compressor.LinkStatus = revitCompressor.LinkStatus; compressor.UpdatePropStatus(nameof(compressor.LinkStatus), revitCompressor, nameof(revitCompressor.LinkStatus)); compressor.Material = revitCompressor.Material; compressor.UpdatePropStatus(nameof(compressor.Material), revitCompressor, nameof(revitCompressor.Material)); compressor.Diameter = revitCompressor.Diameter; compressor.UpdatePropStatus(nameof(compressor.Diameter), revitCompressor, nameof(revitCompressor.Diameter)); compressor.MinorLoss = revitCompressor.MinorLoss; compressor.UpdatePropStatus(nameof(compressor.MinorLoss), revitCompressor, nameof(revitCompressor.MinorLoss)); compressor.CurveQL = revitCompressor.CurveQL; compressor.UpdatePropStatus(nameof(compressor.CurveQL), revitCompressor, nameof(revitCompressor.CurveQL)); if (allScenePropValueList == null) { allScenePropValueList = new List(); } var scenePropValueList = revitCompressor.PropValueList?.Select(x => new Yw.Model.HydroParterScenePropValueInfo() { Parter = revitCompressor.Id, Scene = HStation.Revit.ConstParas.Scene, PropName = x.PropName, PropValue = x.PropValue }).ToList(); if (scenePropValueList != null && scenePropValueList.Count > 0) { allScenePropValueList.AddRange(scenePropValueList); } return compressor; } } }