My apologies, I didn't read properly.
Could this be a display issue?
Maybe if you compare the result of vlax-curve-getclosestpointto with that of osnap you will find that they are in fact the same.
Thanks Roy, you were correct.. the result of
vlax-curve-getclosestpointto and
osnap "NEA" is the same:
_$ (setq pick (entsel))
(<Entity name: 7ff614707330> (194.919 160.49 0.0))
_$ (defun MkPt ( p col ) (entmake (list (cons 0 "POINT") (cons 62 col) (cons 10 p))) )
MKPT
_$ (MkPt (vlax-curve-getclosestpointto (car pick) (trans (cadr pick) 1 0)) 3)
((0 . "POINT") (62 . 3) (10 193.414 162.184 0.0))
_$ (MkPt (osnap (cadr pick) "_NEA") 2)
((0 . "POINT") (62 . 2) (10 193.414 162.184 0.0))
_$ (MkPt (cadr pick) 1)
((0 . "POINT") (62 . 1) (10 194.919 160.49 0.0))
_$
As you can see in the image, they are lying ontop of each other:
However, when I zoom in:
Perhaps this issue occurs when a "real curve" is selected (like circle/arc/bulge/spline).
I performed the same test on a line/straight segment, and the
vlax-curve-getclosestpointto and
osnap "NEA" are located correctly on the line.
Seems to be a display issue, like you said.
Still I've rarely seen the
osnap function being used by one, I'll give it my shot with
grread.
I know about LM's grsnap and seems a tedious combo, but I'll try something simple.