你这while后面也没有东西了啊- (defun c:tt (/ findxmin p1 ss x1 x2 y1)
- (defun findxmin(/ a ent n xmin y)
- (setq n 0)
- (setq ent (ssname ss 0))
- (setq xmin (cadr (assoc 10 (entget ent))))
- (repeat(sslength ss)
- (setq ent (entget (ssname ss n)))
- (setq a (cadr (assoc 10 ent)))
- (setq y (caddr (assoc 10 ent)))
- (if (< a xmin) (setq xmin a))
- (setq n (1+ n))
- )
- (princ)
- )
- (setvar "cmdecho" 0)
- (princ "\n选择第一个选择集")
- (setq ss (ssget (list '(0 . "LINE"))))
- (while (and ss (> (sslength ss) 0))
- (findxmin)
- (setq x1 xmin)
- (setq y1 y)
- (princ "\n选择第二个选择集")
- (setq ss (ssget (list '(0 . "LINE"))))
- (if (and ss (> (sslength ss) 0))
- (progn
- (findxmin)
- (setq x2 xmin)
- (setq p1 (list xmin y1))
- (command "move" ss "" (cdr (assoc 10 ent)) p1)
- )
- )
- (princ "\n选择第一个选择集")
- (setq ss (ssget (list '(0 . "LINE"))))
- )
- (princ)
- )
|