vlax-curve-getClosestPointToProjection

(vlax-curve-getClosestPointToProjection ename point normal [extension_flag])

The vlax-curve-getClosestPointToProjection function finds the coordinates of the point that is on an entity and, after projection onto a specified plane, is the closest to the specified point.

The function projects the entity onto the plane defined by the point and normal, and then calculates the nearest point on that projected entity to point. The resulting point is then projected back onto the original entity, and the function returns that projected point.

Arguments

ename specifies the entity to relate to.

point specifies the point from which to search as a list of three floating-point numbers representing the WCS point coordinates. The projection will be perfomed on a plane passing through this point.

normal specifies the normal to the projection plane as a list of three floating-point numbers representing the WCS coordinates ot that normal.

extension_flag is a flag. If specified and not nil, the function extends the curve when searching for the nearest point.

Return Value

The function returns the point on the specified entity nearest to the specified point as a list of three floating-point numbers representing the WCS coordinates of the calculated point. If the function fails, it returns nil.