列表不能被替换
本帖最后由 Comming 于 2013-12-11 10:32 编辑不知那里出了问题,列表不能替换,烦请大家指点,谢谢!
(defun c:dq()
(setvar "cmdecho"0)
(setq n 0)
(setq txt-x(entget(car(entsel))))
(setq x(cadr(assoc 10 txt-x)))
(setq ss(ssget))
(repeat (SSLENGTH ss)
(setq en(ssname ss n))
(setq data-old(assoc 10 (entget en)))
(setq y-old(cddr data-old))
(setq stype(cdr(assoc 0 (entget en))))
(if (= stype "TEXT")(sub-cons))
)
)
(defun sub-cons()
(setq xyz(cons x y-old))
(setq new-id(cons 10 xyz))
(setq new-data(subst new-id data-old new-data))
(entmod new-data)
)
(setq xyz(cons x y-old))
改为(setq xyx (list x y-old)) 自贡黄明儒 发表于 2013-12-11 10:37 static/image/common/back.gif
(setq xyz(cons x y-old))
改为(setq xyx (list x y-old))
大哥,还是不行 (defun c:dq()
(setvar "cmdecho" 0)
(setq n 0)
(setq txt-x(entget(car(entsel))))
(setq x (assoc 10 txt-x))
(setq ss(ssget (list '(0 . "text"))))
(repeat (SSLENGTH ss)
(setq en (ssname ss n) n (1+ n))
(setq data-old (assoc 10 (entget en)))
(setq new-data (subst x data-old (entget en)))
(entmod new-data)
)
(setvar "cmdecho" 1)
(princ)
)
页:
[1]