;; | ---------------------------------------------------------------------------- ;; | PL_DelPoint ;; | ---------------------------------------------------------------------------- ;; | Function : Deletes a point from a POLYLINE ;; | Arguments: ;; | 'ename' - The name of the POLYLINE entity ;; | 'Pt' - The point on the polyline to delete ;; | Action : Deletes the point from the polyline (or LWPOLYLINE) ;; | Returns T if successful else returns nil ;; | Updated : December 28, 1998 ;; | Comments : Handles both POLYLINE as well as LWPOLYLINE objects. ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ---------------------------------------------------------------------------- (defun PL_DelPoint( ename Pt / More vlist cnt More len _Pt Deleted OS BulgeLst ) (setq OS (getvar "OSMODE")) (setvar "OSMODE" 0) (setq vlist (PL_plist ename) len (length vlist) cnt 0 More T Deleted nil ) (GE_Zoom2Lst vlist) (if (> len 2) (progn (setq BulgeLst (PL_GetBulgeLst ename)) (command "._Pedit" ename "_Edit") (while More (setq _Pt (nth cnt vlist)) (if (equal _Pt Pt 0.001) (progn (cond ((= cnt 0) (command "_Move" (nth 1 vlist) "_Straighten" "_Next") ; Two "Next" are required only if the segment ; under consideration is a stright line (zero bulge) (if (= (car BulgeLst) 0.0) (command "_Next") ) (command "_Go") ) ((= cnt (1- len)) (command "_Next" "_Move" (nth (1- cnt) vlist) "_Straighten" "_Next") ; Two "Next" are required only if the segment ; under consideration is a stright line (zero bulge) (if (= (last BulgeLst) 0.0) (command "_Next") ) (command "_Go") ) (T (command "_Previous" "_Straighten" "_Next" "_Next" "_Go") ) ) (setq Deleted T) ) (command "_Next") ) (setq cnt (1+ cnt)) (if (= cnt len) (setq More nil)) ) (command "_X" "_X") )) (setvar "OSMODE" OS) Deleted )