AutoLISP FAQ (part 2/2) - samples, code [21.7] Select all visible objects: zoom coordinates Beware that with (ssget) you will only get visible objects, because all interface functions (entsel,ssget,osnap) work with pixel, only (ssget "X") will select not visible objects. ;;; returns a list of the actual viewport corners in WCS (defun ZOOMPTS ( / ctr h screen ratio size size_2) (setq ctr (xy-of (getvar "VIEWCTR")) ;3D -> 2D h (getvar "VIEWSIZE") ;real screen (getvar "SCREENSIZE") ;2D: Pixel x,y ratio (/ (float (car screen)) ;aspect ratio (cadr screen)) size (list (* h ratio) h) ;screensize in coords size_2 (mapcar '/ size '(2.0 2.0))) (list (mapcar '- ctr size_2) (mapcar '+ ctr size_2))) |