@sHubamyadav016 hi,
You are aiming very high 🤣, FIND is a very strong command with dialog interface that scans the database as a whole working on texts, mtexts, dimensions, leaders and block attributes. cloning such a command require a lot of coding but to give a tiny touch on what that involve, here is MFIND command to find & replace on selected texts objects.
(defun c:mfind (/ text_replace ; local function
FWhat RWith i ename ;| local variables |;)
(defun text_replace (ent oldStr newStr / edata text)
(setq edata (entget ent))
(setq text (cdr (assoc '1 edata)))
; loop to replace duplicate oldStr
(while (vl-string-search oldStr text)
(setq text (vl-string-subst newStr oldStr text))
)
; update entity database
(entmod (subst (cons '1 text) (assoc '1 edata) edata))
); text_replace
; here start c:mfind
(if (and
(/= (setq FWhat (getstring "\nFind what: ")) "")
(/= (setq RWith (getstring "\nReplace width: ")) "")
(setq ss (ssget '((0 . "text"))))
)
(progn
(setq i -1)
(repeat (sslength ss)
(setq i (1+ i))
(setq ename (ssname ss i))
(text_replace ename FWhat RWith)
); repeat
); progn
); if
(princ)
); c:mfind
enjoy
Moshe