- ;属性替换 明经 ZZXXQQ 2008.12.27-2010.5.19-2016.5.20
- (defun TT (oldlab newtxt)
- (if (and (princ "\nSelect a Block have old attribute 选择带属性图块 :")
- (setq SS (ssget '((0 . "INSERT") (66 . 1))))
- ) (progn
- (setq I 0)
- (repeat (sslength SS)
- (setq EN (ssname SS I) ENT (entget EN))
- (setq I (1+ I) ENT1 ENT)
- (while (/= (cdr(assoc 0 (setq ENT1 (entget(entnext(cdr(assoc -1 ENT1))))))) "SEQEND")
- (if (= (cdr(assoc 0 ENT1)) "ATTRIB")
- (if (= (cdr(assoc 2 ENT3)) oldlab) (progn
- (setq ENT1 (subst (cons 1 newtxt) (assoc 1 ENT1) ENT1))
- (entmod ENT1)
- (entmod ENT)
- ))
- )
- )
- )
- ))
- (princ)
- )
(tt "PTCODE" "") |