编号要怎么修改才可以款选自动编号呢 谁能完善下呢谢谢
(defun c:tt ()(setq ss (ssget))
(setq i 0)
(setq pts nil)
(repeat (sslength ss)
(setq pt (cdr (assoc 10 (entget (ssname ss i)))))
(setq pts (append pts (list pt)))
(setq i (1+ i))
)
(setq pts_y (vl-sort pts '(lambda (x y )(> (cadr x )(cadr y)))))
(setq y (cadr (car pts_y)))
(setq i 0 pts_x nil)
(setq dis 0 pts_xy nil)
(repeat (length pts_y)
(setq pts_now (nth i pts_y))
(if (equal (cadr pts_now ) y dis)
(progn (setq pts_x (append pts_x (list pts_now))))
(progn (setq pts_xy (append pts_xy (list pts_x)))
(setq pts_x (append (list pts_now)))
(setq y (cadr pts_now))
)
)
(setq i (1+ i))
)
(setq pts_xy (append pts_xy (list pts_x)))
(print pts_xy)
(setq i 0 pts_end nil)
(repeat (length pts_xy)
(setq pts_end (append pts_end (list (vl-sort (nth i pts_xy ) '(lambda (x y )(< (car x)(car y)))))))
(setq i (1+ i))
)
(setq i 1)
(repeat (sslength ss)
(foreach pts pts_end
(foreach pt pts (command "text" "m" pt "50" "0"i ))
)
(setq i(+ i 1))
)
)
什么意思??????? 框选同时相同的为一个编号,更好
页:
[1]