匿名用户
1级
2017-12-26 回答
;;;已为你写好程序,功能比你要求的还要好
(print "图号修改(型如GCGS2010-165-19,若为多行文字请先炸开),命令:thxg")
(defun c:thxg(/ all endno aa bb cc wz tha thh thq th srz)
(if (null xzz) (setq xzz 0))
(setq srz(getint (strcat "输入修正值:")))
(if (not (null srz)) (setq xzz srz))
(setq ALL (ssget(list (cons 0 "text"))))
(if all (SETQ nn (SSLENGTH ALL)))
(print (strcat "设定的修改值为:" (itoa xzz)))
(setq endno 0)
(WHILE (and (< endno nn) all)
(setq aa (ssname all endno))
(setq bb (entget aa))
(setq cc(cdr(assoc 1 bb)))
(setq wz(rinstr cc "-"))
(setq tha(substr cc (+ wz 1) ( - (strlen cc) wz -1)))
(setq thh(itoa (+ (atoi tha) xzz)))
(setq thq (substr cc 1 wz))
(setq th(strcat thq thh))
(setq bb (subst (cons 1 th) (assoc 1 bb) bb))