| | |
| | | namespace HStation.Service |
| | | using System.Transactions; |
| | | |
| | | namespace HStation.Service |
| | | { |
| | | /// <summary> |
| | | /// Revit Json辅助类 |
| | |
| | | reservoir.ModelType = jobject[RevitJsonProp.ModelType].ToString(); |
| | | reservoir.Flags = Yw.Untity.FlagsHelper.ToList(jobject[RevitJsonProp.Flags].ToString()); |
| | | reservoir.Description = jobject[RevitJsonProp.Description].ToString(); |
| | | var connectList = JsonHelper.Json2Object<List<RevitJsonConnectModel>>(jobject[RevitJsonProp.Connects].ToString()); |
| | | reservoir.ConnectList = connectList?.Select(x => new Model.RevitConnect() |
| | | { |
| | | Id = x.ConnectId, |
| | | Direction = x.Dirction, |
| | | Position = new Model.RevitPosition() |
| | | { |
| | | X = x.Point.X, |
| | | Y = x.Point.Y, |
| | | Z = x.Point.Z |
| | | } |
| | | }).ToList(); |
| | | |
| | | if (jobject[RevitJsonProp.Quality].MatchNumeric(out double quality)) |
| | | { |
| | | reservoir.Quality = quality; |
| | | } |
| | | var linkList = JsonHelper.Json2Object<List<RevitJsonLinkerModel>>(jobject[RevitJsonProp.Links].ToString()); |
| | | var centerPoint = linkList.GetCenterPoint(); |
| | | reservoir.Position = new Model.RevitPosition() |
| | | { |
| | | X = centerPoint.X, |
| | | Y = centerPoint.Y, |
| | | Z = centerPoint.Z |
| | | }; |
| | | reservoir.Position = reservoir.ConnectList.GetCenterPosition(); |
| | | if (jobject[RevitJsonProp.PoolElev].MatchNumeric(out double poolElev)) |
| | | { |
| | | reservoir.PoolElev = poolElev; |
| | |
| | | tank.ModelType = jobject[RevitJsonProp.ModelType].ToString(); |
| | | tank.Flags = Yw.Untity.FlagsHelper.ToList(jobject[RevitJsonProp.Flags].ToString()); |
| | | tank.Description = jobject[RevitJsonProp.Description].ToString(); |
| | | var connectList = JsonHelper.Json2Object<List<RevitJsonConnectModel>>(jobject[RevitJsonProp.Connects].ToString()); |
| | | tank.ConnectList = connectList?.Select(x => new Model.RevitConnect() |
| | | { |
| | | Id = x.ConnectId, |
| | | Direction = x.Dirction, |
| | | Position = new Model.RevitPosition() |
| | | { |
| | | X = x.Point.X, |
| | | Y = x.Point.Y, |
| | | Z = x.Point.Z |
| | | } |
| | | }).ToList(); |
| | | if (jobject[RevitJsonProp.Quality].MatchNumeric(out double quality)) |
| | | { |
| | | tank.Quality = quality; |
| | | } |
| | | var linkList = JsonHelper.Json2Object<List<RevitJsonLinkerModel>>(jobject[RevitJsonProp.Links].ToString()); |
| | | var centerPoint = linkList.GetCenterPoint(); |
| | | tank.Position = new Model.RevitPosition() |
| | | { |
| | | X = centerPoint.X, |
| | | Y = centerPoint.Y, |
| | | Z = centerPoint.Z |
| | | }; |
| | | tank.Position = tank.ConnectList.GetCenterPosition(); |
| | | if (jobject[RevitJsonProp.PoolElev].MatchNumeric(out double poolElev)) |
| | | { |
| | | tank.PoolElev = poolElev; |
| | |
| | | waterbox.ModelType = jobject[RevitJsonProp.ModelType].ToString(); |
| | | waterbox.Flags = Yw.Untity.FlagsHelper.ToList(jobject[RevitJsonProp.Flags].ToString()); |
| | | waterbox.Description = jobject[RevitJsonProp.Description].ToString(); |
| | | var connectList = JsonHelper.Json2Object<List<RevitJsonConnectModel>>(jobject[RevitJsonProp.Connects].ToString()); |
| | | waterbox.ConnectList = connectList?.Select(x => new Model.RevitConnect() |
| | | { |
| | | Id = x.ConnectId, |
| | | Direction = x.Dirction, |
| | | Position = new Model.RevitPosition() |
| | | { |
| | | X = x.Point.X, |
| | | Y = x.Point.Y, |
| | | Z = x.Point.Z |
| | | } |
| | | }).ToList(); |
| | | if (jobject[RevitJsonProp.Quality].MatchNumeric(out double quality)) |
| | | { |
| | | waterbox.Quality = quality; |
| | | } |
| | | var linkList = JsonHelper.Json2Object<List<RevitJsonLinkerModel>>(jobject[RevitJsonProp.Links].ToString()); |
| | | var centerPoint = linkList.GetCenterPoint(); |
| | | waterbox.Position = new Model.RevitPosition() |
| | | { |
| | | X = centerPoint.X, |
| | | Y = centerPoint.Y, |
| | | Z = centerPoint.Z |
| | | }; |
| | | waterbox.Position = waterbox.ConnectList.GetCenterPosition(); |
| | | if (jobject[RevitJsonProp.PoolElev].MatchNumeric(out double poolElev)) |
| | | { |
| | | waterbox.PoolElev = poolElev; |
| | |
| | | junction.ModelType = jobject[RevitJsonProp.ModelType].ToString(); |
| | | junction.Flags = Yw.Untity.FlagsHelper.ToList(jobject[RevitJsonProp.Flags].ToString()); |
| | | junction.Description = jobject[RevitJsonProp.Description].ToString(); |
| | | var connectList = JsonHelper.Json2Object<List<RevitJsonConnectModel>>(jobject[RevitJsonProp.Connects].ToString()); |
| | | junction.ConnectList = connectList?.Select(x => new Model.RevitConnect() |
| | | { |
| | | Id = x.ConnectId, |
| | | Direction = x.Dirction, |
| | | Position = new Model.RevitPosition() |
| | | { |
| | | X = x.Point.X, |
| | | Y = x.Point.Y, |
| | | Z = x.Point.Z |
| | | } |
| | | }).ToList(); |
| | | if (jobject[RevitJsonProp.Quality].MatchNumeric(out double quality)) |
| | | { |
| | | junction.Quality = quality; |
| | | } |
| | | var linkList = JsonHelper.Json2Object<List<RevitJsonLinkerModel>>(jobject[RevitJsonProp.Links].ToString()); |
| | | var centerPoint = linkList.GetCenterPoint(); |
| | | junction.Position = new Model.RevitPosition() |
| | | { |
| | | X = centerPoint.X, |
| | | Y = centerPoint.Y, |
| | | Z = centerPoint.Z |
| | | }; |
| | | junction.Position = junction.ConnectList.GetCenterPosition(); |
| | | if (jobject[RevitJsonProp.Elev].MatchNumeric(out double elev)) |
| | | { |
| | | junction.Elev = elev; |
| | |
| | | elbow.ModelType = jobject[RevitJsonProp.ModelType].ToString(); |
| | | elbow.Flags = Yw.Untity.FlagsHelper.ToList(jobject[RevitJsonProp.Flags].ToString()); |
| | | elbow.Description = jobject[RevitJsonProp.Description].ToString(); |
| | | var connectList = JsonHelper.Json2Object<List<RevitJsonConnectModel>>(jobject[RevitJsonProp.Connects].ToString()); |
| | | elbow.ConnectList = connectList?.Select(x => new Model.RevitConnect() |
| | | { |
| | | Id = x.ConnectId, |
| | | Direction = x.Dirction, |
| | | Position = new Model.RevitPosition() |
| | | { |
| | | X = x.Point.X, |
| | | Y = x.Point.Y, |
| | | Z = x.Point.Z |
| | | } |
| | | }).ToList(); |
| | | if (jobject[RevitJsonProp.Quality].MatchNumeric(out double quality)) |
| | | { |
| | | elbow.Quality = quality; |
| | | } |
| | | var linkList = JsonHelper.Json2Object<List<RevitJsonLinkerModel>>(jobject[RevitJsonProp.Links].ToString()); |
| | | var centerPoint = linkList.GetCenterPoint(); |
| | | elbow.Position = new Model.RevitPosition() |
| | | { |
| | | X = centerPoint.X, |
| | | Y = centerPoint.Y, |
| | | Z = centerPoint.Z |
| | | }; |
| | | elbow.Position = elbow.ConnectList.GetCenterPosition(); |
| | | if (jobject[RevitJsonProp.Elev].MatchNumeric(out double elev)) |
| | | { |
| | | elbow.Elev = elev; |
| | |
| | | threelink.ModelType = jobject[RevitJsonProp.ModelType].ToString(); |
| | | threelink.Flags = Yw.Untity.FlagsHelper.ToList(jobject[RevitJsonProp.Flags].ToString()); |
| | | threelink.Description = jobject[RevitJsonProp.Description].ToString(); |
| | | var connectList = JsonHelper.Json2Object<List<RevitJsonConnectModel>>(jobject[RevitJsonProp.Connects].ToString()); |
| | | threelink.ConnectList = connectList?.Select(x => new Model.RevitConnect() |
| | | { |
| | | Id = x.ConnectId, |
| | | Direction = x.Dirction, |
| | | Position = new Model.RevitPosition() |
| | | { |
| | | X = x.Point.X, |
| | | Y = x.Point.Y, |
| | | Z = x.Point.Z |
| | | } |
| | | }).ToList(); |
| | | if (jobject[RevitJsonProp.Quality].MatchNumeric(out double quality)) |
| | | { |
| | | threelink.Quality = quality; |
| | | } |
| | | var linkList = JsonHelper.Json2Object<List<RevitJsonLinkerModel>>(jobject[RevitJsonProp.Links].ToString()); |
| | | var centerPoint = linkList.GetCenterPoint(); |
| | | threelink.Position = new Model.RevitPosition() |
| | | { |
| | | X = centerPoint.X, |
| | | Y = centerPoint.Y, |
| | | Z = centerPoint.Z |
| | | }; |
| | | threelink.Position = threelink.ConnectList.GetCenterPosition(); |
| | | if (jobject[RevitJsonProp.Elev].MatchNumeric(out double elev)) |
| | | { |
| | | threelink.Elev = elev; |
| | |
| | | fourlink.ModelType = jobject[RevitJsonProp.ModelType].ToString(); |
| | | fourlink.Flags = Yw.Untity.FlagsHelper.ToList(jobject[RevitJsonProp.Flags].ToString()); |
| | | fourlink.Description = jobject[RevitJsonProp.Description].ToString(); |
| | | var connectList = JsonHelper.Json2Object<List<RevitJsonConnectModel>>(jobject[RevitJsonProp.Connects].ToString()); |
| | | fourlink.ConnectList = connectList?.Select(x => new Model.RevitConnect() |
| | | { |
| | | Id = x.ConnectId, |
| | | Direction = x.Dirction, |
| | | Position = new Model.RevitPosition() |
| | | { |
| | | X = x.Point.X, |
| | | Y = x.Point.Y, |
| | | Z = x.Point.Z |
| | | } |
| | | }).ToList(); |
| | | if (jobject[RevitJsonProp.Quality].MatchNumeric(out double quality)) |
| | | { |
| | | fourlink.Quality = quality; |
| | | } |
| | | var linkList = JsonHelper.Json2Object<List<RevitJsonLinkerModel>>(jobject[RevitJsonProp.Links].ToString()); |
| | | var centerPoint = linkList.GetCenterPoint(); |
| | | fourlink.Position = new Model.RevitPosition() |
| | | { |
| | | X = centerPoint.X, |
| | | Y = centerPoint.Y, |
| | | Z = centerPoint.Z |
| | | }; |
| | | fourlink.Position = fourlink.ConnectList.GetCenterPosition(); |
| | | if (jobject[RevitJsonProp.Elev].MatchNumeric(out double elev)) |
| | | { |
| | | fourlink.Elev = elev; |
| | |
| | | meter.ModelType = jobject[RevitJsonProp.ModelType].ToString(); |
| | | meter.Flags = Yw.Untity.FlagsHelper.ToList(jobject[RevitJsonProp.Flags].ToString()); |
| | | meter.Description = jobject[RevitJsonProp.Description].ToString(); |
| | | var connectList = JsonHelper.Json2Object<List<RevitJsonConnectModel>>(jobject[RevitJsonProp.Connects].ToString()); |
| | | meter.ConnectList = connectList?.Select(x => new Model.RevitConnect() |
| | | { |
| | | Id = x.ConnectId, |
| | | Direction = x.Dirction, |
| | | Position = new Model.RevitPosition() |
| | | { |
| | | X = x.Point.X, |
| | | Y = x.Point.Y, |
| | | Z = x.Point.Z |
| | | } |
| | | }).ToList(); |
| | | if (jobject[RevitJsonProp.Quality].MatchNumeric(out double quality)) |
| | | { |
| | | meter.Quality = quality; |
| | | } |
| | | var linkList = JsonHelper.Json2Object<List<RevitJsonLinkerModel>>(jobject[RevitJsonProp.Links].ToString()); |
| | | var centerPoint = linkList.GetCenterPoint(); |
| | | meter.Position = new Model.RevitPosition() |
| | | { |
| | | X = centerPoint.X, |
| | | Y = centerPoint.Y, |
| | | Z = centerPoint.Z |
| | | }; |
| | | meter.Position = meter.ConnectList.GetCenterPosition(); |
| | | if (jobject[RevitJsonProp.Elev].MatchNumeric(out double elev)) |
| | | { |
| | | meter.Elev = elev; |
| | |
| | | flowmeter.ModelType = jobject[RevitJsonProp.ModelType].ToString(); |
| | | flowmeter.Flags = Yw.Untity.FlagsHelper.ToList(jobject[RevitJsonProp.Flags].ToString()); |
| | | flowmeter.Description = jobject[RevitJsonProp.Description].ToString(); |
| | | var connectList = JsonHelper.Json2Object<List<RevitJsonConnectModel>>(jobject[RevitJsonProp.Connects].ToString()); |
| | | flowmeter.ConnectList = connectList?.Select(x => new Model.RevitConnect() |
| | | { |
| | | Id = x.ConnectId, |
| | | Direction = x.Dirction, |
| | | Position = new Model.RevitPosition() |
| | | { |
| | | X = x.Point.X, |
| | | Y = x.Point.Y, |
| | | Z = x.Point.Z |
| | | } |
| | | }).ToList(); |
| | | if (jobject[RevitJsonProp.Quality].MatchNumeric(out double quality)) |
| | | { |
| | | flowmeter.Quality = quality; |
| | | } |
| | | var linkList = JsonHelper.Json2Object<List<RevitJsonLinkerModel>>(jobject[RevitJsonProp.Links].ToString()); |
| | | var centerPoint = linkList.GetCenterPoint(); |
| | | flowmeter.Position = new Model.RevitPosition() |
| | | { |
| | | X = centerPoint.X, |
| | | Y = centerPoint.Y, |
| | | Z = centerPoint.Z |
| | | }; |
| | | flowmeter.Position = flowmeter.ConnectList.GetCenterPosition(); |
| | | if (jobject[RevitJsonProp.Elev].MatchNumeric(out double elev)) |
| | | { |
| | | flowmeter.Elev = elev; |
| | |
| | | pressmeter.ModelType = jobject[RevitJsonProp.ModelType].ToString(); |
| | | pressmeter.Flags = Yw.Untity.FlagsHelper.ToList(jobject[RevitJsonProp.Flags].ToString()); |
| | | pressmeter.Description = jobject[RevitJsonProp.Description].ToString(); |
| | | var connectList = JsonHelper.Json2Object<List<RevitJsonConnectModel>>(jobject[RevitJsonProp.Connects].ToString()); |
| | | pressmeter.ConnectList = connectList?.Select(x => new Model.RevitConnect() |
| | | { |
| | | Id = x.ConnectId, |
| | | Direction = x.Dirction, |
| | | Position = new Model.RevitPosition() |
| | | { |
| | | X = x.Point.X, |
| | | Y = x.Point.Y, |
| | | Z = x.Point.Z |
| | | } |
| | | }).ToList(); |
| | | if (jobject[RevitJsonProp.Quality].MatchNumeric(out double quality)) |
| | | { |
| | | pressmeter.Quality = quality; |
| | | } |
| | | var linkList = JsonHelper.Json2Object<List<RevitJsonLinkerModel>>(jobject[RevitJsonProp.Links].ToString()); |
| | | var centerPoint = linkList.GetCenterPoint(); |
| | | pressmeter.Position = new Model.RevitPosition() |
| | | { |
| | | X = centerPoint.X, |
| | | Y = centerPoint.Y, |
| | | Z = centerPoint.Z |
| | | }; |
| | | pressmeter.Position = pressmeter.ConnectList.GetCenterPosition(); |
| | | if (jobject[RevitJsonProp.Elev].MatchNumeric(out double elev)) |
| | | { |
| | | pressmeter.Elev = elev; |
| | |
| | | blunthead.ModelType = jobject[RevitJsonProp.ModelType].ToString(); |
| | | blunthead.Flags = Yw.Untity.FlagsHelper.ToList(jobject[RevitJsonProp.Flags].ToString()); |
| | | blunthead.Description = jobject[RevitJsonProp.Description].ToString(); |
| | | var connectList = JsonHelper.Json2Object<List<RevitJsonConnectModel>>(jobject[RevitJsonProp.Connects].ToString()); |
| | | blunthead.ConnectList = connectList?.Select(x => new Model.RevitConnect() |
| | | { |
| | | Id = x.ConnectId, |
| | | Direction = x.Dirction, |
| | | Position = new Model.RevitPosition() |
| | | { |
| | | X = x.Point.X, |
| | | Y = x.Point.Y, |
| | | Z = x.Point.Z |
| | | } |
| | | }).ToList(); |
| | | if (jobject[RevitJsonProp.Quality].MatchNumeric(out double quality)) |
| | | { |
| | | blunthead.Quality = quality; |
| | | } |
| | | var linkList = JsonHelper.Json2Object<List<RevitJsonLinkerModel>>(jobject[RevitJsonProp.Links].ToString()); |
| | | var centerPoint = linkList.GetCenterPoint(); |
| | | blunthead.Position = new Model.RevitPosition() |
| | | { |
| | | X = centerPoint.X, |
| | | Y = centerPoint.Y, |
| | | Z = centerPoint.Z |
| | | }; |
| | | blunthead.Position = blunthead.ConnectList.GetCenterPosition(); |
| | | if (jobject[RevitJsonProp.Elev].MatchNumeric(out double elev)) |
| | | { |
| | | blunthead.Elev = elev; |
| | |
| | | nozzle.ModelType = jobject[RevitJsonProp.ModelType].ToString(); |
| | | nozzle.Flags = Yw.Untity.FlagsHelper.ToList(jobject[RevitJsonProp.Flags].ToString()); |
| | | nozzle.Description = jobject[RevitJsonProp.Description].ToString(); |
| | | var connectList = JsonHelper.Json2Object<List<RevitJsonConnectModel>>(jobject[RevitJsonProp.Connects].ToString()); |
| | | nozzle.ConnectList = connectList?.Select(x => new Model.RevitConnect() |
| | | { |
| | | Id = x.ConnectId, |
| | | Direction = x.Dirction, |
| | | Position = new Model.RevitPosition() |
| | | { |
| | | X = x.Point.X, |
| | | Y = x.Point.Y, |
| | | Z = x.Point.Z |
| | | } |
| | | }).ToList(); |
| | | if (jobject[RevitJsonProp.Quality].MatchNumeric(out double quality)) |
| | | { |
| | | nozzle.Quality = quality; |
| | | } |
| | | var linkList = JsonHelper.Json2Object<List<RevitJsonLinkerModel>>(jobject[RevitJsonProp.Links].ToString()); |
| | | var centerPoint = linkList.GetCenterPoint(); |
| | | nozzle.Position = new Model.RevitPosition() |
| | | { |
| | | X = centerPoint.X, |
| | | Y = centerPoint.Y, |
| | | Z = centerPoint.Z |
| | | }; |
| | | nozzle.Position = nozzle.ConnectList.GetCenterPosition(); |
| | | if (jobject[RevitJsonProp.Elev].MatchNumeric(out double elev)) |
| | | { |
| | | nozzle.Elev = elev; |
| | |
| | | hydrant.ModelType = jobject[RevitJsonProp.ModelType].ToString(); |
| | | hydrant.Flags = Yw.Untity.FlagsHelper.ToList(jobject[RevitJsonProp.Flags].ToString()); |
| | | hydrant.Description = jobject[RevitJsonProp.Description].ToString(); |
| | | var connectList = JsonHelper.Json2Object<List<RevitJsonConnectModel>>(jobject[RevitJsonProp.Connects].ToString()); |
| | | hydrant.ConnectList = connectList?.Select(x => new Model.RevitConnect() |
| | | { |
| | | Id = x.ConnectId, |
| | | Direction = x.Dirction, |
| | | Position = new Model.RevitPosition() |
| | | { |
| | | X = x.Point.X, |
| | | Y = x.Point.Y, |
| | | Z = x.Point.Z |
| | | } |
| | | }).ToList(); |
| | | if (jobject[RevitJsonProp.Quality].MatchNumeric(out double quality)) |
| | | { |
| | | hydrant.Quality = quality; |
| | | } |
| | | var linkList = JsonHelper.Json2Object<List<RevitJsonLinkerModel>>(jobject[RevitJsonProp.Links].ToString()); |
| | | var centerPoint = linkList.GetCenterPoint(); |
| | | hydrant.Position = new Model.RevitPosition() |
| | | { |
| | | X = centerPoint.X, |
| | | Y = centerPoint.Y, |
| | | Z = centerPoint.Z |
| | | }; |
| | | hydrant.Position = hydrant.ConnectList.GetCenterPosition(); |
| | | if (jobject[RevitJsonProp.Elev].MatchNumeric(out double elev)) |
| | | { |
| | | hydrant.Elev = elev; |
| | |
| | | exchanger.ModelType = jobject[RevitJsonProp.ModelType].ToString(); |
| | | exchanger.Flags = Yw.Untity.FlagsHelper.ToList(jobject[RevitJsonProp.Flags].ToString()); |
| | | exchanger.Description = jobject[RevitJsonProp.Description].ToString(); |
| | | if (jobject[RevitJsonProp.Quality].MatchNumeric(out double quality)) |
| | | var connectList = JsonHelper.Json2Object<List<RevitJsonConnectModel>>(jobject[RevitJsonProp.Connects].ToString()); |
| | | exchanger.ConnectList = connectList?.Select(x => new Model.RevitConnect() |
| | | { |
| | | exchanger.Quality = quality; |
| | | Id = x.ConnectId, |
| | | Direction = x.Dirction, |
| | | Position = new Model.RevitPosition() |
| | | { |
| | | X = x.Point.X, |
| | | Y = x.Point.Y, |
| | | Z = x.Point.Z |
| | | } |
| | | }).ToList(); |
| | | var startConnect = exchanger.ConnectList.GetStartConnect(); |
| | | var endConnect = exchanger.ConnectList.GetEndConnect(); |
| | | exchanger.StartCode = startConnect.Id; |
| | | exchanger.EndCode = endConnect.Id; |
| | | exchanger.StartPosition = startConnect.Position; |
| | | exchanger.EndPosition = endConnect.Position; |
| | | exchanger.LinkStatus = jobject[RevitJsonProp.LinkStatusPipe].ToString(); |
| | | if (jobject[RevitJsonProp.StartElev].MatchNumeric(out double startElev)) |
| | | { |
| | | exchanger.StartElev = startElev; |
| | | } |
| | | var linkList = JsonHelper.Json2Object<List<RevitJsonLinkerModel>>(jobject[RevitJsonProp.Links].ToString()); |
| | | var centerPoint = linkList.GetCenterPoint(); |
| | | exchanger.Position = new Model.RevitPosition() |
| | | if (jobject[RevitJsonProp.EndElev].MatchNumeric(out double endElev)) |
| | | { |
| | | X = centerPoint.X, |
| | | Y = centerPoint.Y, |
| | | Z = centerPoint.Z |
| | | }; |
| | | if (jobject[RevitJsonProp.Elev].MatchNumeric(out double elev)) |
| | | { |
| | | exchanger.Elev = elev; |
| | | exchanger.EndElev = endElev; |
| | | } |
| | | if (jobject[RevitJsonProp.Demand].MatchNumeric(out double demand)) |
| | | if (jobject[RevitJsonProp.StartQuality].MatchNumeric(out double startQuality)) |
| | | { |
| | | exchanger.Demand = demand; |
| | | exchanger.StartQuality = startQuality; |
| | | } |
| | | exchanger.DemandPattern = jobject[RevitJsonProp.DemandPattern].ToString(); |
| | | if (jobject[RevitJsonProp.EndQuality].MatchNumeric(out double endQuality)) |
| | | { |
| | | exchanger.EndQuality = endQuality; |
| | | } |
| | | |
| | | if (jobject[RevitJsonProp.Length].MatchNumeric(out double length)) |
| | | { |
| | | exchanger.Length = length; |
| | | } |
| | | if (jobject[RevitJsonProp.Diameter].MatchNumeric(out double diameter)) |
| | | { |
| | | exchanger.Diameter = diameter; |
| | | } |
| | | else if (jobject[RevitJsonProp.InternalDiameter].MatchNumeric(out double internalDiameter)) |
| | | { |
| | | exchanger.Diameter = internalDiameter; |
| | | } |
| | | if (jobject[RevitJsonProp.MinorLoss].MatchNumeric(out double minorLoss)) |
| | | { |
| | | exchanger.MinorLoss = minorLoss; |
| | | } |
| | | if (jobject[RevitJsonProp.Roughness].MatchNumeric(out double roughness)) |
| | | { |
| | | exchanger.Roughness = roughness; |
| | | } |
| | | if (exchanger.Length <= 0) |
| | | { |
| | | exchanger.Length = exchanger.StartPosition.Distance(exchanger.EndPosition); |
| | | } |
| | | if (exchanger.Diameter < 0.1) |
| | | { |
| | | exchanger.Diameter = 0.1; |
| | | } |
| | | if (exchanger.Roughness < 0.1) |
| | | { |
| | | exchanger.Roughness = 0.1; |
| | | } |
| | | model.Exchangers.Add(exchanger); |
| | | } |
| | | break; |
| | |
| | | pipe.ModelType = jobject[RevitJsonProp.ModelType].ToString(); |
| | | pipe.Flags = Yw.Untity.FlagsHelper.ToList(jobject[RevitJsonProp.Flags].ToString()); |
| | | pipe.Description = jobject[RevitJsonProp.Description].ToString(); |
| | | var linkList = JsonHelper.Json2Object<List<RevitJsonLinkerModel>>(jobject[RevitJsonProp.Links].ToString()); |
| | | var startLinker = linkList.GetStartLinker(); |
| | | var endLinker = linkList.GetEndLinker(); |
| | | pipe.StartCode = startLinker.ConnectId; |
| | | pipe.EndCode = endLinker.ConnectId; |
| | | pipe.StartPosition = new Model.RevitPosition() |
| | | var connectList = JsonHelper.Json2Object<List<RevitJsonConnectModel>>(jobject[RevitJsonProp.Connects].ToString()); |
| | | pipe.ConnectList = connectList?.Select(x => new Model.RevitConnect() |
| | | { |
| | | X = startLinker.Point.X, |
| | | Y = startLinker.Point.Y, |
| | | Z = startLinker.Point.Z |
| | | }; |
| | | pipe.EndPosition = new Model.RevitPosition() |
| | | { |
| | | X = endLinker.Point.X, |
| | | Y = endLinker.Point.Y, |
| | | Z = endLinker.Point.Z |
| | | }; |
| | | Id = x.ConnectId, |
| | | Direction = x.Dirction, |
| | | Position = new Model.RevitPosition() |
| | | { |
| | | X = x.Point.X, |
| | | Y = x.Point.Y, |
| | | Z = x.Point.Z |
| | | } |
| | | }).ToList(); |
| | | var startConnect = pipe.ConnectList.GetStartConnect(); |
| | | var endConnect = pipe.ConnectList.GetEndConnect(); |
| | | pipe.StartCode = startConnect.Id; |
| | | pipe.EndCode = endConnect.Id; |
| | | pipe.StartPosition = startConnect.Position; |
| | | pipe.EndPosition = endConnect.Position; |
| | | pipe.LinkStatus = jobject[RevitJsonProp.LinkStatusPipe].ToString(); |
| | | if (jobject[RevitJsonProp.StartElev].MatchNumeric(out double startElev)) |
| | | { |
| | |
| | | { |
| | | pipe.Roughness = roughness; |
| | | } |
| | | if (pipe.Length <= 0) |
| | | { |
| | | pipe.Length = pipe.StartPosition.Distance(pipe.EndPosition); |
| | | } |
| | | if (pipe.Diameter < 0.1) |
| | | { |
| | | pipe.Diameter = 0.1; |
| | | } |
| | | if (pipe.Roughness < 0.1) |
| | | { |
| | | pipe.Roughness = 0.1; |
| | | } |
| | | model.Pipes.Add(pipe); |
| | | } |
| | | break; |
| | |
| | | translation.ModelType = jobject[RevitJsonProp.ModelType].ToString(); |
| | | translation.Flags = Yw.Untity.FlagsHelper.ToList(jobject[RevitJsonProp.Flags].ToString()); |
| | | translation.Description = jobject[RevitJsonProp.Description].ToString(); |
| | | var linkList = JsonHelper.Json2Object<List<RevitJsonLinkerModel>>(jobject[RevitJsonProp.Links].ToString()); |
| | | var startLinker = linkList.GetStartLinker(); |
| | | var endLinker = linkList.GetEndLinker(); |
| | | translation.StartCode = startLinker.ConnectId; |
| | | translation.EndCode = endLinker.ConnectId; |
| | | translation.StartPosition = new Model.RevitPosition() |
| | | var connectList = JsonHelper.Json2Object<List<RevitJsonConnectModel>>(jobject[RevitJsonProp.Connects].ToString()); |
| | | translation.ConnectList = connectList?.Select(x => new Model.RevitConnect() |
| | | { |
| | | X = startLinker.Point.X, |
| | | Y = startLinker.Point.Y, |
| | | Z = startLinker.Point.Z |
| | | }; |
| | | translation.EndPosition = new Model.RevitPosition() |
| | | { |
| | | X = endLinker.Point.X, |
| | | Y = endLinker.Point.Y, |
| | | Z = endLinker.Point.Z |
| | | }; |
| | | Id = x.ConnectId, |
| | | Direction = x.Dirction, |
| | | Position = new Model.RevitPosition() |
| | | { |
| | | X = x.Point.X, |
| | | Y = x.Point.Y, |
| | | Z = x.Point.Z |
| | | } |
| | | }).ToList(); |
| | | var startConnect = translation.ConnectList.GetStartConnect(); |
| | | var endConnect = translation.ConnectList.GetEndConnect(); |
| | | translation.StartCode = startConnect.Id; |
| | | translation.EndCode = endConnect.Id; |
| | | translation.StartPosition = startConnect.Position; |
| | | translation.EndPosition = endConnect.Position; |
| | | translation.LinkStatus = jobject[RevitJsonProp.LinkStatusPipe].ToString(); |
| | | if (jobject[RevitJsonProp.StartElev].MatchNumeric(out double startElev)) |
| | | { |
| | |
| | | { |
| | | translation.Roughness = roughness; |
| | | } |
| | | if (translation.Length <= 0) |
| | | { |
| | | translation.Length = translation.StartPosition.Distance(translation.EndPosition); |
| | | } |
| | | if (translation.Diameter < 0.1) |
| | | { |
| | | translation.Diameter = 0.1; |
| | | } |
| | | if (translation.Roughness < 0.1) |
| | | { |
| | | translation.Roughness = 0.1; |
| | | } |
| | | model.Translations.Add(translation); |
| | | } |
| | | break; |
| | |
| | | pump.ModelType = jobject[RevitJsonProp.ModelType].ToString(); |
| | | pump.Flags = Yw.Untity.FlagsHelper.ToList(jobject[RevitJsonProp.Flags].ToString()); |
| | | pump.Description = jobject[RevitJsonProp.Description].ToString(); |
| | | var linkList = JsonHelper.Json2Object<List<RevitJsonLinkerModel>>(jobject[RevitJsonProp.Links].ToString()); |
| | | var startLinker = linkList.GetStartLinker(); |
| | | var endLinker = linkList.GetEndLinker(); |
| | | pump.StartCode = startLinker.ConnectId; |
| | | pump.EndCode = endLinker.ConnectId; |
| | | pump.StartPosition = new Model.RevitPosition() |
| | | var connectList = JsonHelper.Json2Object<List<RevitJsonConnectModel>>(jobject[RevitJsonProp.Connects].ToString()); |
| | | pump.ConnectList = connectList?.Select(x => new Model.RevitConnect() |
| | | { |
| | | X = startLinker.Point.X, |
| | | Y = startLinker.Point.Y, |
| | | Z = startLinker.Point.Z |
| | | }; |
| | | pump.EndPosition = new Model.RevitPosition() |
| | | { |
| | | X = endLinker.Point.X, |
| | | Y = endLinker.Point.Y, |
| | | Z = endLinker.Point.Z |
| | | }; |
| | | Id = x.ConnectId, |
| | | Direction = x.Dirction, |
| | | Position = new Model.RevitPosition() |
| | | { |
| | | X = x.Point.X, |
| | | Y = x.Point.Y, |
| | | Z = x.Point.Z |
| | | } |
| | | }).ToList(); |
| | | var startConnect = pump.ConnectList.GetStartConnect(); |
| | | var endConnect = pump.ConnectList.GetEndConnect(); |
| | | pump.StartCode = startConnect.Id; |
| | | pump.EndCode = endConnect.Id; |
| | | pump.StartPosition = startConnect.Position; |
| | | pump.EndPosition = endConnect.Position; |
| | | pump.LinkStatus = jobject[RevitJsonProp.LinkStatusPump].ToString(); |
| | | if (jobject[RevitJsonProp.StartElev].MatchNumeric(out double startElev)) |
| | | { |
| | |
| | | valve.ModelType = jobject[RevitJsonProp.ModelType].ToString(); |
| | | valve.Flags = Yw.Untity.FlagsHelper.ToList(jobject[RevitJsonProp.Flags].ToString()); |
| | | valve.Description = jobject[RevitJsonProp.Description].ToString(); |
| | | var linkList = JsonHelper.Json2Object<List<RevitJsonLinkerModel>>(jobject[RevitJsonProp.Links].ToString()); |
| | | var startLinker = linkList.GetStartLinker(); |
| | | var endLinker = linkList.GetEndLinker(); |
| | | valve.StartCode = startLinker.ConnectId; |
| | | valve.EndCode = endLinker.ConnectId; |
| | | valve.StartPosition = new Model.RevitPosition() |
| | | var connectList = JsonHelper.Json2Object<List<RevitJsonConnectModel>>(jobject[RevitJsonProp.Connects].ToString()); |
| | | valve.ConnectList = connectList?.Select(x => new Model.RevitConnect() |
| | | { |
| | | X = startLinker.Point.X, |
| | | Y = startLinker.Point.Y, |
| | | Z = startLinker.Point.Z |
| | | }; |
| | | valve.EndPosition = new Model.RevitPosition() |
| | | { |
| | | X = endLinker.Point.X, |
| | | Y = endLinker.Point.Y, |
| | | Z = endLinker.Point.Z |
| | | }; |
| | | Id = x.ConnectId, |
| | | Direction = x.Dirction, |
| | | Position = new Model.RevitPosition() |
| | | { |
| | | X = x.Point.X, |
| | | Y = x.Point.Y, |
| | | Z = x.Point.Z |
| | | } |
| | | }).ToList(); |
| | | var startConnect = valve.ConnectList.GetStartConnect(); |
| | | var endConnect = valve.ConnectList.GetEndConnect(); |
| | | valve.StartCode = startConnect.Id; |
| | | valve.EndCode = endConnect.Id; |
| | | valve.StartPosition = startConnect.Position; |
| | | valve.EndPosition = endConnect.Position; |
| | | valve.LinkStatus = jobject[RevitJsonProp.LinkStatusValve].ToString(); |
| | | if (jobject[RevitJsonProp.StartElev].MatchNumeric(out double startElev)) |
| | | { |