Is there an API (or set of API's) that gives us the the position (and normal direction) of a point clicked on the geometry?
SolidworksApi macros
Is there an API (or set of API's) that gives us the the position (and normal direction) of a point clicked on the geometry?
SolidworksApi macros
You can use ISelectionMgr::GetSelectedObject6 and ISelectionMgr::GetSelectionPoint2 along with the INormal property of the IFace2 class.
Keep in mind there is no 'normal' direction for a point such as a vertex. It would have to be a face, or your would have to get the face of he selected object (component, body, etc).
Jim S.
Thanks Jim,
Unfortunately, INormal only returns the normal of a PLANAR face. I want the normal at any given point on a face, even non-planar faces. ie the reflected normal of a ray that would fire from the camera to the point selected.
In that case, use the above along with IFace2::GetSurface follwed by ISurface::EvaluateAtPoint.
Jim S.
Perfect! Thanks for the help.