整理代码
This commit is contained in:
@@ -0,0 +1,206 @@
|
||||
using Autodesk.Revit.DB;
|
||||
|
||||
namespace ShrlAlgo.RvKits.RvIndependent.NetworkCreator
|
||||
{
|
||||
public class ExcelDataRow
|
||||
{
|
||||
/// <summary>
|
||||
/// 对齐方式
|
||||
/// </summary>
|
||||
public AlignType AlignType
|
||||
{
|
||||
get
|
||||
{
|
||||
return Top switch
|
||||
{
|
||||
0.0 => AlignType.Bottom,
|
||||
_ => AlignType.Top,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 管中心坐标
|
||||
/// </summary>
|
||||
public XYZ CenterPoint => Location - new XYZ(0, 0, Offest) * 1000 / 304.8;
|
||||
|
||||
/// <summary>
|
||||
/// 节点附属定位点
|
||||
/// </summary>
|
||||
public XYZ Location => new XYZ(X, Y, GroundElev) * 1000 / 304.8;
|
||||
|
||||
/// <summary>
|
||||
/// 截面高度
|
||||
/// </summary>
|
||||
public double SectionHeight
|
||||
{
|
||||
get
|
||||
{
|
||||
if (SectionType == SectionType.Rectangle)
|
||||
{
|
||||
var s = Size.ToUpper().Split('X');
|
||||
return Convert.ToDouble(s.Last());
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 截面类型
|
||||
/// </summary>
|
||||
public SectionType SectionType
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Size.Contains("X"))
|
||||
{
|
||||
return SectionType.Rectangle;
|
||||
}
|
||||
|
||||
return SectionType.Circle;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 截面宽度
|
||||
/// </summary>
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 唯一节点
|
||||
/// </summary>
|
||||
public bool HasManHole { get; set; } = true;
|
||||
|
||||
public double X { get; set; }
|
||||
|
||||
public double Y { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 地面高程
|
||||
/// </summary>
|
||||
public double GroundElev { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 管顶
|
||||
/// </summary>
|
||||
public double Top { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 管内底
|
||||
/// </summary>
|
||||
public double InnerBottom { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// //埋深=地面高程-管顶/管内底:groundElev-top/innerBottom
|
||||
/// </summary>
|
||||
public double Depth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 起点节点号
|
||||
/// </summary>
|
||||
public string StartId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 管线点号
|
||||
/// </summary>
|
||||
public string Number { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 连接点号
|
||||
/// </summary>
|
||||
public string EndId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 埋设方式
|
||||
/// </summary>
|
||||
public string LayingMode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 管材
|
||||
/// </summary>
|
||||
public string Material { get; set; }
|
||||
|
||||
public string Size { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 特征
|
||||
/// </summary>
|
||||
public string Feature { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 节点类型
|
||||
/// </summary>
|
||||
public string AccessoryType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 电缆根数或总孔数/已用孔数
|
||||
/// </summary>
|
||||
public string NumberOfCablesOrHoles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 管孔排列(行X列)
|
||||
/// </summary>
|
||||
public string ArrangementOfHoles { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 电力电压(KV)/压力
|
||||
/// </summary>
|
||||
public string VoltageorPressure { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 备注
|
||||
/// </summary>
|
||||
public string Remarks { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user