 - (defun xBox(s / x p a b lx);;选择集、图元(对象)表、图元(对象)包容盒
- (setq s(if(/=(type s)'pickset)(if(listp s)s(list s))(s2e s)))
- (while s
- (setq x(car s)s(cdr s)a nil b nil)
- (cond((=(setq lx(type x))'ename)(vla-getboundingbox(vlax-ename->vla-object x)'a'b))
- ((= lx'vla-object)(vla-getboundingbox x'a'b))
- ((and(= lx 'list)(not(VL-CATCH-ALL-ERROR-P(VL-CATCH-ALL-APPLY'vlax-3d-point x))))x))
- (if a(setq p(revappend(mapcar'vlax-safearray->list(list a b))p))
- (setq p(cons x p))))
- (boxofpts p))
- (defun BOXofPtS(pt)
- (setq pt(mapcar'(lambda(x)(mapcar x pt))'(car cadr)))
- (mapcar'(lambda(y)(mapcar'(lambda(x)(apply y x))pt))'(min max)))
- (defun s2e(s / n lst)(if(=(type s)'pickset)(repeat(setq n(sslength s))(setq n(1- n)lst(cons(ssname s n)lst)))))
- (defun c:tt(/ d s box)
- (if(setq s(s2e(ssget '((0 . "circle,arc,ellipse,spline,line,*polyline")))))
- (setq box(xBox s)d(getreal"偏移距离")
- box(apply'command(cons"rectang"(mapcar'(lambda(X y)(mapcar'+ x y))box(list(list(- d)(- d))(list d d))))))))
|