- (defun c:tt(/ a b ddy dy i lst n nptlst ptlst ss ssn ylst)
- (if
- (setq ss (ssget '((0 . "line"))))
- (progn
- (setq i -1
- lst nil
- )
- (while (setq ssn (ssname ss (setq i (1+ i))))
- (setq lst (cons ssn lst))
- )
- (setq lst(vl-sort lst '(lambda(x y)(>(caddr(assoc 10 (entget x)))(caddr(assoc 10 (entget y)))))))
- (setq ptlst(mapcar '(lambda(x)(cdr(assoc 10 (entget x))))lst))
- (setq dy(- (setq a(cadr(car ptlst)))(setq b(cadr(last ptlst)))))
- (setq n(length lst)
- ddy(/ dy (1- n)))
- (setq ylst (list b))
- (setq i 1)
- (repeat (1- n)
- (setq ylst(cons (+ b (* i ddy))ylst))
- (setq i (1+ i))
- )
- (setq nptlst(mapcar '(lambda(x y) (list (car x)y))ptlst ylst))
- (setq lst(mapcar 'list lst ptlst nptlst))
- (foreach a lst(command "move" (car a)""(cadr a)(last a)))
-
- )
- )
- (princ)
- )
|