I am trying to find a way to efficiently measure the distance to the extreme point of a Temporary Body along a ray, starting from a specific coordinates (say 0;0;0), and going along a vector (say, 1;0;0), as illustrated below:
There is an API call GetExtremePoint, however, it searches for the extreme point on the body not along the ray, but along a general direction vector (from solidworks.help: This method returns the furthest possible point of intersection between a plane normal to the direction vector specified and the model as the plane moves along the direction vector). That method would return the distance to the maximum width of the ellipse seen in the screenshot, rather than the distance of the ray (red line). In other words, what I need is the distance between the origin and the intersection between the body and the ray.
I know this could be done quite simply with sketches or by cutting the body, but I need something very efficient, as I'll need to run this measurement hundreds of times per operation with various starting points and vectors. Can anyone suggest any API call or some alternate approach to achieve this?
Thanks in advance.