Jump to content

Change Existing Text to Number?


AQucsaiJr

Recommended Posts

I have existing text in my drawing that has already been lined up the way it should exist. Anyone know of a way to just click on the text an have it auto overwrite each test with incrementing numbers...

 

For instance if I have 10 individual lines of text that all read "example text" and I wanted to change them all to 1 to 10 respectively.

 

I have been through the majority of the Auto-Numbering LISP files on the forum and, unless I missed it, I can not find one that does this.

Link to comment
Share on other sites

Well I guess now is as good a time as any to register at the swamp... I will be able to try this link once registered.

Link to comment
Share on other sites

Is this what you're looking for?

Another cool tool from ASMI.

 

AsmiTools_Renum.gif

 

;;                                                                      ;;
;; ==================================================================== ;;
;;                                                                      ;;
;;  RENUM.LSP - This program converts TEXT, MTEXT and ATTRIBUTES in     ;;
;;              numbers with a prefix and a suffix.                     ;;
;;                                                                      ;;
;; ==================================================================== ;;
;;                                                                      ;;
;;  Command(s) to call: RENUM                                           ;;
;;                                                                      ;;
;;  Specify a suffix, a prefix and starting number (for erase the old   ;;
;;  suffix or prefix you should press Spacebar). Pick to TEXT, MTEXT    ;;
;;  ATTRIBUTES or press Esc to quit. The program remembers old          ;;
;;  properties and it is possible to confirm it pressing of Spacebar    ;;
;;  key.                                                                ;;
;;                                                                      ;;
;; ==================================================================== ;;
;;                                                                      ;;
;;  THIS PROGRAM AND PARTS OF IT MAY REPRODUCED BY ANY METHOD ON ANY    ;;
;;  MEDIUM FOR ANY REASON. YOU CAN USE OR MODIFY THIS PROGRAM OR        ;;
;;  PARTS OF IT ABSOLUTELY FREE.                                        ;;
;;                                                                      ;;
;;  THIS PROGRAM PROVIDES 'AS IS' WITH ALL FAULTS AND SPECIFICALLY      ;;
;;  DISCLAIMS ANY IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS        ;;
;;  FOR A PARTICULAR USE.                                               ;;
;;                                                                      ;;
;; ==================================================================== ;;
;;                                                                      ;;
;;  V1.0, 16 June, 2005, Riga, Latvia                                   ;;
;;  © Aleksandr Smirnov (ASMI)                                          ;;
;;  For AutoCAD 2000 - 2008 (isn't tested in a next versions)           ;;
;;                                                                      ;;
;;                             http://www.asmitools.com                 ;;
;;                                                                      ;;
;; ==================================================================== ;;



(defun c:renum (/ oldPref oldSuf oldStart curText curStr) 
 (vl-load-com) 
 (if(not rnm:Pref)(setq rnm:Pref "")) 
 (if(not rnm:Suf)(setq rnm:Suf "")) 
 (if(not rnm:Start)(setq rnm:Start 1)) 
 (setq oldPref rnm:Pref 
       oldSuf rnm:Suf 
       oldStart rnm:Start); end setq 
 (setq rnm:Pref 
   (getstring T 
     (strcat "\nPrefix: <"rnm:Pref">: "))) 
 (if(= "" rnm:Pref)(setq rnm:Pref oldPref)) 
 (if(= " " rnm:Pref)(setq rnm:Pref "")) 
 (setq rnm:Suf 
   (getstring T 
     (strcat "\nSuffix: <"rnm:Suf">: "))) 
 (if(= "" rnm:Suf)(setq rnm:Suf oldSuf)) 
 (if(= " " rnm:Suf)(setq rnm:Suf "")) 
 (setq rnm:Start 
   (getint 
     (strcat "\nStarting number <" 
        (itoa rnm:Start)">: "))) 
 (if(null rnm:Start)(setq rnm:Start oldStart))
    (while T 
      (setq curStr(strcat rnm:Pref(itoa rnm:Start)rnm:Suf)) 
        (setq curText 
          (car 
            (nentsel "\n<<< Pick TEXT, MTEXT or ATTRIBUTE or press Esc to quit >>> "))) 
      (if 
        (and 
          curText 
          (member(cdr(assoc 0(entget curText))) '("TEXT" "MTEXT" "ATTRIB")) 
          ); end and 
        (progn 
        (vla-put-TextString 
          (vlax-ename->vla-object curText)curStr) 
           (setq rnm:Start(1+ rnm:Start)) 
        ); end progn 
       (princ "\n This is not DText or MText ") 
       ); end if 
      ); end while 
  (princ) 
 ); end of c:renum

(princ "\n[info] http:\\\\www.AsmiTools.com [info]")
(princ "\n[info] Renumber tool. Type RENUM to run. [info]")

Link to comment
Share on other sites

do a find and replace. works very well from autocad 2005 onwards.

 

Even with incrementing numbers?

 

Also, just thought - my program (AutoNum V4), has a replacement option, which will do what you want - can't believe i forgot about that! :oops:

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...