wimal Posted September 6, 2018 Posted September 6, 2018 (setq e (entget entNotation)) (setq st (cdr (assoc 1 e)) ) (entmod (subst (cons 1 (vl-string-subst replace44 find44 st)) (assoc 1 e) e)) This code can find some texts and replace some other texts into the string. But how can I add new texts to the front or end of the string. Quote
mr-blue Posted September 6, 2018 Posted September 6, 2018 (edited) You need to replace vl-string-subst with strcat so to append to the end of the existiring string the code would look like this: (setq e (entget entNotation)) (setq st (cdr (assoc 1 e)) ) (entmod (subst (cons 1 (strcat (cdr (assoc 1 e)) replace44)) (assoc 1 e) e)) Edited September 6, 2018 by mr-blue 1 Quote
satishrajdev Posted September 6, 2018 Posted September 6, 2018 Try this, if you don't want to add any new string just set N as "". (setq n "123") (entmod (subst (cons 1 (strcat n (vl-string-subst replace44 find44 st))) (assoc 1 e) e ) ) 1 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.