使用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);
您的代码的纵断面也是平面线,您可以试试创建一条斜线作为纵断面线。
你好,感谢回复。按照你说的设置了参数,但还是分成了两条线:
因为我们这个曲线是在铁路车站内,所以一般都是水平的直线,一般没有斜线的情况。
这个属于工程意义上的,我看来是正确的,这个您得查看一下纵断面线和平面线之间得距离,然后看看您代码中得Z值是不是等于这个距离,需要把UOR也考虑进去。目前肯定得是,如果纵断面也是一条直线,如果高程值不等于0,那么肯定是不重合得。您可以通过代码获取某个distancealonge处得高程值double ptZ = profileGemo.GetYAtX(distance, 1e-6);
我构建平面线和纵断面线的点集是一模一样的,且他们的Z值都不为零。我现在用的UOR都是1.
我查看了我们以前用过的一个dgn文件,这个里面的平面线和纵断面线就是重合的:
但是这个项目里面的纵面不是直线而且是带地形的。