老师好,ComplexStringElement提取如下,获取的只能是一段元素的,
CurvePrimitive cp = CurvePathQuery.ElementToCurveVector(Elem).GetPrimitive(0);//Elem 是ComplexStringElement
cp.ClosestPointBounded(ev.Point, out fraction, out Point);//Point是线上点
我怎么才能获得鼠标点在ComplexStringElement线上点?也尝试了CurveVector的获取方式
直接调用CurveVector的ClosestPointBounded函数就可以了,不用再调用GetPrimitive去取其子链。
CurveVector cveVec = CurvePathQuery.ElementToCurveVector(ele1); cveVec.ClosestPointBounded
MS学习资源:
MicroStation Wednesday视频分享
深入探讨MicroStation DGN基本概念系列
一步步学习MicroStation CE Addin开发
一步步学习MicroStation CE MDL开发
郭老师,CurveVector的ClosestPointBounded函数只能传进去一个点,没有办法根据我鼠标点返回复杂链的点
CurveVector的ClosestPointBounded成员函数返回了一个CurveLocationDetail的实例对象,您要的点可以通过这个CurveLocationDetail实例获得: