Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4331

[CONNECT C++] FractionToPoint()

$
0
0

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


Viewing all articles
Browse latest Browse all 4331

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>