AVINAWSH Posted February 4 Posted February 4 (edited) Bellow lisp is find & replacing multiple words with wildcard match in autocad. I need same or similar lisp searching whole word match. Anybody please help me. (defun C:RT (/ adoc List$) (vl-load-com) (setq $List '(("D.F." "DF") ("MOI" "JOI"))) ; (Old$ New$) (setq adoc (vla-get-activedocument (vlax-get-acad-object))) (vlax-for lt (vla-get-layouts adoc) (vlax-for obj (vla-get-block lt) (if (eq "AcDbText" (vla-get-objectname obj)) (mapcar '(lambda(x) (while (vl-string-search (car x) (vla-get-textstring obj)) (vla-put-textstring obj (vl-string-subst (cadr x) (car x) (vla-get-textstring obj))) ) ) $List) ) ) ) (princ) ) Edited February 4 by SLW210 Added Code Tags! Quote
SLW210 Posted February 4 Posted February 4 Please use Code Tags for your Code in the future. (<> in the editor toolbar) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.