一个怎么编号的问题
www.dimcax.com
一个怎么编号的问题
请问怎样才能给一个闭合的多线段在图上自动编上序号,可以加前缀的。
d
;;;下面程序用于在多段线的结点上标注数字或字符和圆圈,供你参考。
(defun c:ddxjdbz (/ p r n e qz xw)
(setq e (entget (car (entsel "\n请选择需要标注的多段线:"))))
(setq r 1)
(setq n (getint "\n输入起始数:"))
(setq h (getreal "\n输入标注字体高度:"))
(if (= n nil)
(setq n 1)
)
(setq qz (getstring "\n请输入前缀字符(如无前缀字符则直接回车):"))
(if
(= (tblobjname "layer" "dmh")
nil
)
(progn
(command "layer" "n" "dmh" "c" "50" "dmh" "")
)
)
(setvar "clayer" "dmh")
(setq xw (getint "\n是否需在结点添加圆圈<1>是;<2>否:"))
(srblc)
(setq l (getvar "ltscale"))
(while r
(progn
(setq p (cdr (assoc 10 e)))
(setq e (cdr (member (assoc 10 e) e)))
(if (/= qz nil)
(progn
(setq n1 (strcat qz (itoa n)))
(command "text" "s" "standard" "j" "bl" p h 0 n1 )
)
)
(if (= qz nil)
(command "text" "s" "standard" "j" "bl" p h 0 n )
)
(if (= xw 1)
(progn
(entmake (list (cons 0 "insert")
(cons 100 "acdbentity")
(cons 8 "gcd")
(cons 100 "acdbblockreference")
(cons 10 p)
(cons 41 1)
(cons 42 1)
(cons 43 1)
(cons 410 "model")
(cons 2 "gc
d
(srblc)??????????????????????????????????//
d
不能用,呵呵,不过这里的气氛还真不错!
d
编号顺序有什么要求没?可以用程序过滤组码,得闭合多段线的选择集,然后逐一得到每个闭合对象的中心点,写入编号数字.也可按点击顺序编号