- (defun c:tt()
- (if (setq ss (ssget '((0 . "line"))))
- (progn
- (setq n -1)
- (while (setq ent (ssname ss (setq n (1+ n))))
- (vla-GetBoundingBox (vlax-ename->vla-object ent) 'minpt 'maxpt)
- (entdel ent)
- (setq lst (mapcar '(lambda(x) (vlax-safearray->list x)) (list minpt maxpt)))
- (setq minpt (car lst) maxpt (cadr lst))
- (setq lst (list minpt (list (car maxpt) (cadr minpt)) maxpt (list (car minpt) (cadr maxpt))))
- (entmake (append (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") (cons 90 (length lst)) '(70 . 1)) (mapcar '(lambda (pt) (cons 10 pt)) lst)))
- )
- )
- )
- (prin1)
- )
|