如何得到模型空间当前视图的最大坐标和最小坐标
<p>也就是左下角点和右上角点坐标。</p><p>viewctr只能得到中心坐标,viewsize只能得到高度。如何得到宽度?</p> <p>AutoLISP FAQ (part 2/2) - samples, code </p><p> Select all visible objects: zoom coordinates</p><p> Beware that with (ssget) you will only get visible objects, because<br/> all interface functions (entsel,ssget,osnap) work with pixel, only<br/> (ssget "X") will select not visible objects.</p><p> ;;; returns a list of the actual viewport corners in WCS<br/> (defun ZOOMPTS ( / ctr h screen ratio size size_2)<br/> (setq ctr (xy-of (getvar "VIEWCTR")) ;3D -> 2D<br/> h (getvar "VIEWSIZE") ;real<br/> screen (getvar "SCREENSIZE") ;2D: Pixel x,y<br/> ratio (/ (float (car screen)) ;aspect ratio<br/> (cadr screen))<br/> size (list (* h ratio) h) ;screensize in coords<br/> size_2 (mapcar '/ size '(2.0 2.0)))<br/> (list (mapcar '- ctr size_2)<br/> (mapcar '+ ctr size_2)))</p> <p>vxmax和vxmin</p> 用到了谢谢,分享
页:
[1]