;; 没必要需要排序
- (defun c:tt ()
- "视口修剪"
- (defun mimx (s1 / p1 p9)
- (vla-getboundingbox (vlax-ename->vla-object s1) 'p1 'p9)
- (list (vlax-safearray->list p1) (vlax-safearray->list p9))
- )
- (setq i -1)
- (if (setq ss (ssget '((0 . "*poly*"))))
- (while (setq s1 (ssname ss (setq i (1+ i))))
- (setq a (mimx s1)
- p1 (car a)
- p9 (cadr a)
- )
- (vla-put-Closed (vlax-ename->vla-object s1) :vlax-true)
- (if (and (setq ss1 (ssget "c" p1 p9 '((0 . "VIEWPORT"))))
- (= (sslength ss1) 1)
- )
- (command "_vpclip" (ssname ss1 0) s1)
- )
- )
- )
- (princ)
- )
|