I am attempting to find the tangent of a linear element at it's intersection with another element in a DgnElementSetTool. I can retrieve a CurveVectorPtr of the picked location, but I cannot figure out how to get a ICurvePrimitivePtr which is required for calling FractionToPoint().
CurveVectorPtr curve = ICurvePathQuery::ElementToCurveVector(el); ICurvePrimitivePtr primitive = nullptr; // How to initialize pointer ?? CurveLocationDetail location; curve->ClosestPointBounded(pt, location); DPoint3d ptOnLine={0}; DVec3d tangent; primitive->FractionToPoint(location.fraction, ptOnLine, tangent);
My thought is that by using FractionToPoint(), I can get the tangent of the picked element, The element *may* also be multi-segmented (e.g. linestring). I need the tangent in order to align a cell with same rotation as the line segment.
Bruce