- ;;;;功能:最大矩形外框
- ;;;逆流而上的鱼制作
- (defun c:多个矩形框 ( / ent p1 p2 obj k ss p11 p22 dis)
- (vl-load-com)
- (setvar "OSMODE" 0)
- (setq dis (getdist "\n输入边框距离:"))
- (if (and dis
- (setq ss (ssget )))
- (repeat (setq k (sslength ss))
- (setq ent (ssname ss (setq k (1- k))))
- (setq obj (vlax-ename->vla-object ent))
- (vla-getboundingbox obj 'p1 'p2)
- (setq p1 (vlax-safearray->list p1)
- p2 (vlax-safearray->list p2)
- )
-
- (setq p11 (mapcar '(lambda(x) (- x dis) )p1) )
- (setq p22 (mapcar '(lambda(x) (+ x dis) )p2) )
- (vl-cmdf "rectang" p11 p22)
- )
- )
- (princ)
- )
|