;;; changetext.lsp ;;; a program that matches text to a source text selected ;;; copyright 1997 by charles robbins ;;; Charles Robbins provides this code for your use. Use the code ;;; to your benifit and at your own risk. Charles Robbins does not ;;; warrant that the code will work error free in your application. (alert "changetext.lsp Copyright 1997 by charles robbins. Type ct to start") ;;; start program (defun c:ct (/) ;;; select text (print "\nSelect the text to change. ") (setq ss1 (ssget)) ;;; ask questions (setq textstring (getstring T "\nType the new text. ")) ;;; change text (setq qty (sslength ss1)) ; quantity of target text target (setq counter 0) ; set counter to 0 (while (< counter qty) ; complete the loop based upon no. of target items (setq entitylist (entget (ssname ss1 counter))) ; acquires text database (setq oldtext (assoc 1 entitylist)) ; acquires old text with group number (setq newtext (cons 1 textstring)) ; newtext is the source text string (setq entitylist (subst newtext oldtext entitylist)) ; substitutes old target text for new source text (entmod entitylist) ; drawing database updated (setq counter (1+ counter)) ; add one to counter ) ;;; end of program (gc) ; removes selection sets from memory (princ) )