Help with LISP !

Hi Im useless at this but maybe someone can help me out and have use for this.
I have a little LISP that allows me to EDIT existing text to a incrementing no. This is sometimes great if I put out flags that I want to number at a later stage.
NOW Could someone see if this also can edit MTEXT ! Among other things I have multileaders that I want to number up

(defun C:incr ()
(setq init_str (getstring "\n Enter Initial Value:"))
(setq inc (getint "\n Enter Increment:"))
(setq init_val (atoi init_str))
(setq init_val_str (itoa init_val))
(setq suffix (vl-string-trim init_val_str init_str))
(setq ss (ssget))
(setq ent (entget (ssname ss 0)))
(setq ent (subst (cons 1 init_str) (assoc 1 ent) ent))
(entmod ent)
(while 1
(setq ss (ssget))
(setq init_val (+ init_val inc))
(setq inc_val (itoa init_val))
(setq ent (entget (ssname ss 0)))
ent (subst (cons 1 (strcat suffix inc_val)) (assoc 1 ent) ent)
(entmod ent)


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!