本帖最后由 Gu_xl 于 2012-5-25 17:50 编辑
- (defun c:tt (/ ss i l1 l2 ll ur os d)
- (setq os (getvar 'osmode))
- (setvar 'osmode 0)
- (setq d (getreal "\n偏距<10>"))
- (if (null d)
- (setq d 10)
- )
- (setq ss (ssget))
- (repeat (setq i (sslength ss))
- (vla-getboundingbox
- (vlax-ename->vla-object (ssname ss (setq i (1- i))))
- 'll
- 'ur
- )
- (setq l1 (cons (vlax-safearray->list ll) l1)
- l2 (cons (vlax-safearray->list ur) l2)
- )
- )
- (mapcar 'set
- (list 'll 'ur)
- (mapcar '(lambda (a b) (apply 'mapcar (cons a b)))
- '(min max)
- (list l1 l2)
- )
- )
- (command
- "rectang"
- (trans (polar ll (* pi 1.25) (setq d (sqrt (+ (* d d) (* d d)))))
- 0
- 1
- )
- (trans (polar ur (* pi 0.25) d) 0 1)
- )
- (setvar 'osmode os)
- (princ)
- )
|