CAD直接修改文字或块的属性内容程序
合集下载
相关主题
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
(setq newt (getstring T (strcat "\nNew text <" oldt ">:")))
(if (= newt "") (setq newt oldt))
(setq ent1 (subst (cons (car (assoc 1 ent)) newt) (assoc 1 ent) ent))
(setq ent1 (subst (cons (car (assoc 1 en)) newt) (assoc 1 en) en))
(entmod ent1)
(entupd ent)
))
((= (cdr (assoc 0 ent)) "TEXT")
(progn
(setq oldt (cdr (assoc 1 ent)))
(progn
(setq en (entget (setq ent (entnext e))))
(setq oldt (cdr (assoc 1 en)))
(setq newt (getstring T (strcat "\nNew text <" oldt ">:")))
(if (= newt "") (setq newt oldt))
(entmod ent1)
))
(T (princ "\nError: Not a text or not a block or no attrib in block !"))
)
)
)
(princ)
)
(defun c:cht(/ e ent en newt oldt ent1)
(setq e (car (entsel "\nPick a text or a attrib: ")))
(if (/= e nil)
(progn
(setq ent (entget e))
(cond ((and (= (cdr源自文库(assoc 0 ent)) "INSERT") (= (cdr (assoc 66 ent)) 1))
(if (= newt "") (setq newt oldt))
(setq ent1 (subst (cons (car (assoc 1 ent)) newt) (assoc 1 ent) ent))
(setq ent1 (subst (cons (car (assoc 1 en)) newt) (assoc 1 en) en))
(entmod ent1)
(entupd ent)
))
((= (cdr (assoc 0 ent)) "TEXT")
(progn
(setq oldt (cdr (assoc 1 ent)))
(progn
(setq en (entget (setq ent (entnext e))))
(setq oldt (cdr (assoc 1 en)))
(setq newt (getstring T (strcat "\nNew text <" oldt ">:")))
(if (= newt "") (setq newt oldt))
(entmod ent1)
))
(T (princ "\nError: Not a text or not a block or no attrib in block !"))
)
)
)
(princ)
)
(defun c:cht(/ e ent en newt oldt ent1)
(setq e (car (entsel "\nPick a text or a attrib: ")))
(if (/= e nil)
(progn
(setq ent (entget e))
(cond ((and (= (cdr源自文库(assoc 0 ent)) "INSERT") (= (cdr (assoc 66 ent)) 1))