wimal Posted September 6, 2018 Share 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 Link to comment Share on other sites More sharing options...
mr-blue Posted September 6, 2018 Share 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 Link to comment Share on other sites More sharing options...
satishrajdev Posted September 6, 2018 Share 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 Link to comment Share on other sites More sharing options...
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.