You could obtain the first derivative vector at the point returned by vlax-curve-getclosestpointto using the vlax-curve-getfirstderiv function, and then calculate the sign of the sine of the angle between your given point, the closest point and the first derivative vector from the closest point.
A couple of months ago I found a function which determines the side here: https://autocadtips1.com/2011/07/04/autolisp-offset-polyline-segments/You could obtain the first derivative vector at the point returned by vlax-curve-getclosestpointto using the vlax-curve-getfirstderiv function, and then calculate the sign of the sine of the angle between your given point, the closest point and the first derivative vector from the closest point.
In code, this might be:Code - Auto/Visual Lisp: [Select]
) ) )Code - Auto/Visual Lisp: [Select]
Thanks for the addition Stefan and what a great way of testing the function.
I noticed you can make a small change which doesn't change any of the calculations:
You can remove the last two "(setq f" parts because the value already is send back by the if function.