using Autodesk.Revit.DB; namespace ShrlAlgoToolkit.RevitAddins.RvIndependent.NetworkCreator { public class ExcelDataRow { /// /// 对齐方式 /// public AlignType AlignType { get { return Top switch { 0.0 => AlignType.Bottom, _ => AlignType.Top, }; } } /// /// 管中心坐标 /// public XYZ CenterPoint => Location - new XYZ(0, 0, Offest) * 1000 / 304.8; /// /// 节点附属定位点 /// public XYZ Location => new XYZ(X, Y, GroundElev) * 1000 / 304.8; /// /// 截面高度 /// public double SectionHeight { get { if (SectionType == SectionType.Rectangle) { var s = Size.ToUpper().Split('X'); return Convert.ToDouble(s.Last()); } return 0; } } /// /// 截面类型 /// public SectionType SectionType { get { if (Size.Contains("X")) { return SectionType.Rectangle; } return SectionType.Circle; } } /// /// 截面宽度 /// public double SectionWidth { get { if (SectionType == SectionType.Rectangle) { var s = Size.ToUpper().Split('X'); return Convert.ToDouble(s.First()); } return 0; } } //垂直截面半高度 private double Half { get { double half; if (SectionType == SectionType.Circle) { half = Convert.ToDouble(Size) / 2; } else { var s = Size.ToUpper().Split('X'); half = Convert.ToDouble(s.Last()) / 2; } return half; } } private double Offest { get { switch (AlignType) { case AlignType.Top: return Depth + Half / 1000; //管中心距离地面高度 case AlignType.Bottom: return Depth - Half / 1000; default: return 0; } } } /// /// 唯一节点 /// public bool HasManHole { get; set; } = true; public double X { get; set; } public double Y { get; set; } /// /// 地面高程 /// public double GroundElev { get; set; } /// /// 管顶 /// public double Top { get; set; } /// /// 管内底 /// public double InnerBottom { get; set; } /// /// //埋深=地面高程-管顶/管内底:groundElev-top/innerBottom /// public double Depth { get; set; } /// /// 起点节点号 /// public string StartId { get; set; } /// /// 管线点号 /// public string Number { get; set; } /// /// 连接点号 /// public string EndId { get; set; } /// /// 埋设方式 /// public string LayingMode { get; set; } /// /// 管材 /// public string Material { get; set; } public string Size { get; set; } /// /// 特征 /// public string Feature { get; set; } /// /// 节点类型 /// public string AccessoryType { get; set; } /// /// 电缆根数或总孔数/已用孔数 /// public string NumberOfCablesOrHoles { get; set; } /// /// 管孔排列(行X列) /// public string ArrangementOfHoles { get; set; } /// /// 电力电压(KV)/压力 /// public string VoltageorPressure { get; set; } /// /// 备注 /// public string Remarks { get; set; } } }