;;; ;;; ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 2-21-96 ;;;> EDITED: 04-08-1997 ;;; (defun c:rtext ( / tset) (setq tset (ssget "x" '((0 . "TEXT"))) sslen (sslength tset) count 0) (setq chstr (getstring "\nString to search for. ") nwstr (getstring "\nString to replace it. ") cstrl (strlen chstr) nstrl (strlen nwstr) cind 1 nind 1 strlm 1) (while (not(eq count sslen)) (princ ".") (setq tent (entget(ssname tset count)) tstr (cdr(assoc 1 tent)) strl (strlen tstr)) (if(not(>= strl cstrl)) nil (while (not (> cind strl)) (if (eq (substr chstr 1 strlm) (substr tstr cind strlm) ) (progn (while (eq (substr chstr 1 strlm) (substr tstr cind strlm) );eq (if (eq strlm cstrl) (progn (setq str1 (if(= cind 1) "" (substr tstr 1 (1- cind)) );if str2 (if(or(<= strl cind)(= cind (1+ cstrl))) "" (substr tstr (1- cind) cstrl) );if );setq (setq istr (strcat str1 nwstr str2) );setq (setq tent (subst (cons 1 istr) (assoc 1 tent) tent ) ) (entmod tent) (princ "entmod") (setq strlm (1+ strlm) cind strl) );progn (setq strlm (1+ strlm)) );if ; (setq strlm (1+ strlm)) );while (princ (strcat "\n"(substr chstr 1 strlm))) (princ (strcat "\n"(substr tstr cind strlm))) (princ "\n ") );progn );if (setq cind (1+ cind) strlm 1) );while );if (setq count (1+ count) strlm 1 cind 1) );while );defun