(defun c:rlt ( / doc layouts)
;;; "T" option for getstring added by Giuseppe Mauro
(vl-load-com)
(cond ((and (/= (setq inpOld (getstring T "\nOriginal text to replace: ")) "")
(/= (setq inpNew (getstring T "\nNew text with which to replace: ")) ""))
(setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
(setq layouts (vla-get-Layouts doc))
(vlax-for layout layouts
(while (vl-string-search inpOld (vla-get-name layout))
(vla-put-name layout (vl-string-subst inpNew inpOld (vla-get-name layout)))))))
(princ))
(c:rlt)

Advertisements