;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Modifed code of Justo Aguiar ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:FG ()
(setq WORD (GETVAR "USERS1"))
(setq OldTxt (getstring T (strcat "\nEnter the existing Text to Find:<" WORD ">"))
NewTxt (getstring T "\nEnter new Text to Replace: "))
(setq count 0)
;;(setq ss (ssget "x" '((0 . "TEXT,MTEXT"))))
(setq ss (ssget "x" (list (cons 0 "AECC_GENERAL_NOTE_LABEL"))))
(setq i (sslength ss))
(while (not (minusp (setq i (1- i))))
(setq oText (vlax-ename->vla-object (ssname ss i)))
(setq Txt (vlax-get-property oText 'LabelTextContent))
(if (vl-string-search OldTxt txt)
(progn
(setq newChg (vl-string-subst NewTxt OldTxt txt))
(vlax-put-property oText 'LabelTextContent newchg)
(vlax-invoke-method oText 'Update)
(setq count (+ count 1))
)
)
)
(prompt (strcat "(" (itoa count) ") Label(s) text Replaced"))
(princ)
)
Can't find what you're looking for? Ask the community or share your knowledge.