Jump to content
AQucsaiJr

Change Existing Text to Number?

Recommended Posts

AQucsaiJr

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.

Share this post


Link to post
Share on other sites
lpseifert

Have you tried the Express Tools' Tcount command?

Share this post


Link to post
Share on other sites
AQucsaiJr

You know... I just asumed that ACAD did not have a tool to do this... I will try that out. Thanks.

Share this post


Link to post
Share on other sites
Lee Mac

Else, I think CAB has a good function for this over at theSwamp.org

Share this post


Link to post
Share on other sites
AQucsaiJr

I think you gave me that link before... I have not been able to find the link you gave me however.

Share this post


Link to post
Share on other sites
AQucsaiJr

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.

Share this post


Link to post
Share on other sites
Lee Mac

Yes, the level of programming at theSwamp.org is a lot lot higher than it is here - but the CAD help here is better. :)

Share this post


Link to post
Share on other sites
JeepMaster
- but the CAD help here is better. :)

That's because we have LeeMac here helping people out. :D

Share this post


Link to post
Share on other sites
JeepMaster

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]")

Share this post


Link to post
Share on other sites
Lee Mac
That's because we have LeeMac here helping people out. :D

 

Thanks Jeep :D

Share this post


Link to post
Share on other sites
asos2000
That's because we have LeeMac here helping people out. :D

 

the same feeling.

Share this post


Link to post
Share on other sites
Zorg

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

Share this post


Link to post
Share on other sites
Lee Mac
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:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×