;; | ---------------------------------------------------------------------------- ;; | GE_SubSeg ;; | ---------------------------------------------------------------------------- ;; | Function : Return a part of a list in between two points. ;; | Arguments: ;; | 'vlist' - List of points ;; | 'p1' - 'First Point' ;; | 'p2' - 'Second Point' ;; | Action : Performs a Zoom Window operation using the bottom left and top ;; | right corners of a list of points ;; | Updated : November 2, 1998 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ---------------------------------------------------------------------------- (defun GE_SubSeg( vlist p1 p2 / tmp Vx1 Vx2 Lst ) (setq Vx1 (GE_LocateVx p1 vlist) Vx2 (GE_LocateVx p2 vlist) Lst '() ) (if (and Vx1 Vx2) (progn (if (< Vx2 Vx1) ; Swap (setq tmp Vx2 Vx2 Vx1 Vx1 tmp tmp p2 p2 p1 p1 tmp )) (if (/= Vx1 Vx2) (progn (setq Lst (LI_SubList vlist Vx1 (1+ (- Vx2 Vx1)))) (if Lst (progn (if (> (distance p1 (car Lst)) 0.0001) (setq Lst (cdr Lst) Lst (cons p1 Lst) ) ) (if (> (distance p2 (last Lst)) 0.0001) (setq Lst (append Lst (list p2))) ) )) ) (progn (if (not (equal p1 p2 0.0001)) (setq Lst (list p1 p2)) ) )) )) Lst )