;;; matchtext.lsp ;;; a program that matches text to a source text selected ;;; copyright 1998 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 "Matchtext.lsp copyright 1998 by charles robbins. Type mt to start") ;;;start program (defun c:mt (/) ;;;select text (print "select source text") (setq ss1 (ssget)) (print "select target text") (setq ss2 (ssget)) ;;;change text (setq qty (sslength ss2)) ; quantity of target text target (setq counter 0) ; set counter to 0 (setq newtext (assoc 1 (entget (ssname ss1 0)))) ; newtext is the source text string (while (< counter qty) ; complete the loop based upon no. of target items (setq entitylist (entget (ssname ss2 counter))) ; acquires text database (setq oldtext (assoc 1 entitylist)) ; gets the text string with group number (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 set from memory (princ) )