;; | ---------------------------------------------------------------------------- ;; | GE_FindNearest ;; | ---------------------------------------------------------------------------- ;; | Function : Find the nearest point on a list of points to a given point. ;; | Arguments: 'pt1' - Point to check ;; | 'vlist' - List of points ;; | 'Mode' - can be either "Slope" or "Horiz", determines the ;; | distance measurement mode ;; | Returns : A point on the list of points 'vlist' which is the nearest to a ;; | given point 'pt1' ;; | Updated : September 24, 2001 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ---------------------------------------------------------------------------- (defun GE_FindNearest ( pt1 vlist Mode / DistLst ) (setq DistLst (GE_SortByDistance vlist pt1 Mode)) (nth 0 DistLst) )