使用C#代码创建了出了ORD的Alignment对象,所使用的坐标点如下:
EXPoint3d point1 = new EXPoint3d(469430, 0, 3443); EXPoint3d point2 = new EXPoint3d(472400, 0, 3443);
首先使用了CreateAlignmentByLinearElement方法创建出了Alignment对象:
// 直线段 DPoint3d startPoint = new DPoint3d(m_points[0].X, m_points[0].Y, m_points[0].Z), endPoint = new DPoint3d(); startPoint.X *= UorPerMas2; startPoint.Y *= UorPerMas2; startPoint.Z *= UorPerMas2; for (int i = 1; i < m_points.Count; i++) { endPoint = new DPoint3d(m_points[i].X, m_points[i].Y, m_points[i].Z); endPoint.X *= UorPerMas2; endPoint.Y *= UorPerMas2; endPoint.Z *= UorPerMas2; //creates a line between each consectutive pair of points Line line = Line.Create1(startPoint, endPoint); lines.Add(line); startPoint = endPoint; } LinearComplex complexAlign = LinearComplex.Create1(lines.ToArray(), false, false, 0.001); Alignment al = con.GetActiveGeometricModel().CreateAlignmentByLinearElement(complexAlign, true);
然后使用了CreateProfileByProfileElement函数创建了纵断面:
var edit = al.CreateProfileByProfileElement(element, true, false);
纵断面截图:
但是,在ORD里面,我看到这两条线好像是分离的状态,如下图:
A点是平面线的起点,Z值是0,B点是纵断面线的起点,高程是3443。
请问正常情况下这两条线是不是应该要重叠在一起?
您试试将最后一个参数给成true
var edit = al.CreateProfileByProfileElement(element, true, true);
您的代码的纵断面也是平面线,您可以试试创建一条斜线作为纵断面线。
你好,感谢回复。按照你说的设置了参数,但还是分成了两条线:
因为我们这个曲线是在铁路车站内,所以一般都是水平的直线,一般没有斜线的情况。
这个需要再3D视图里面切换成顶视图, 你看看是不是合为一体?
顶视图是这样子的,但是我觉得还是不正常
首先CreateAlignmentByLinearElement函数创建的平面线型,给定Z应该为0,整条路线沿里程方向的高程是靠CreateProfileByProfileElement创建出来的。其次,当赋值了Profile以后,模型中应该有两条线,一条是平面线型,一条是三维线型,如果从顶视图上看,它俩是重合的。三维模型不重合,请检查平面线型给定的Z值是否为零。另外执行您的代码时,当前Model应为2DModel。
Answer Verified By: fanghua wei
好的,我现在尝试了下在2D seed里面去创建,在三维view里面的廊道看起来好像正常了。
所以编程还得先学习软件的基本概念和操作。否则一开始就是错的。