nelsongrae Posted September 18, 2008 Share Posted September 18, 2008 I want to add to all my numbers text, eg change 23.45 to 23.45 m there are varios numbers but all need m added. I tried using find replace. But couldnt find a way to keep the existing various numbers while adding the m. I could do one by one change but there are many numbers to have m added to. These are text, there are no dimension leaders or anything else attached to them. I did a forum search and couldn't find anything relevent. I am using autocad 2007 full version Any help would be great . Cheers Graeme Quote Link to comment Share on other sites More sharing options...
nocturne00 Posted September 18, 2008 Share Posted September 18, 2008 Is this for dimensioning? Quote Link to comment Share on other sites More sharing options...
DVDM Posted September 18, 2008 Share Posted September 18, 2008 Look at the find/replace routine in the link below: http://www.cadtutor.net/forum/showthread.php?t=14084&page=2 I take it the replacement has to be done on just about anything between 0.01 and 999.99? If so, you can use this routine to rename anything with .00 to .00 m, .01 to .01 m, etc etc. You could use a program like Mult-Batch 9.0 to call up this lisp routine 100 times, using a different parameter every time, and roll out this change across entire folders/lists of files. It would look something like: (FindReplaceAll ".00" ".00 m") (FindReplaceAll ".01" ".01 m") Etc etc. However, this would change anything with a .?? in it whether it's TEXT, MTEXT, Dimension or Attribute, so be careful it doesn't change values you don't want to change, and test the routine first. Quote Link to comment Share on other sites More sharing options...
skipsophrenic Posted September 18, 2008 Share Posted September 18, 2008 However, this would change anything with a .?? in it whether it's TEXT, MTEXT, Dimension or Attribute, so be careful it doesn't change values you don't want to change, and test the routine first. i'd save a copy and work on the copy, that way if anythin does go wrong you've still got the original to go back to Quote Link to comment Share on other sites More sharing options...
dbroada Posted September 18, 2008 Share Posted September 18, 2008 it is relatively easy to do in LISP or VBA but I don't have the time to write it just now nor do I have anything close. If nobody comes along with anything more suitable I would use the built in AutoCAD find/replace and use the select button to narrow down the items to apply it to. Quote Link to comment Share on other sites More sharing options...
eldon Posted September 18, 2008 Share Posted September 18, 2008 There is somewhere (sorry to be not more helpful ) on this forum a lisp routine TextMath. It was written primarily to add to all the level texts on a drawing to adjust the datum. But it also adds a suffix i.e. m to all the levels. So you can use it by adding zero to all the levels but also adding m as well. Best of luck with your hunt, and there is someone more organised than me to point you in the right direction. Quote Link to comment Share on other sites More sharing options...
nelsongrae Posted September 18, 2008 Author Share Posted September 18, 2008 I know there is a comand for this cause Ive used it in the past but cant remember it. It wasnt a lisp routine. So I dont want to change the text I want to add to them. eg change 26.50, 28.60 35.35 ect to 26.50m, 28.60m, 35.35m and so on. Quote Link to comment Share on other sites More sharing options...
dbroada Posted September 18, 2008 Share Posted September 18, 2008 I know there is a comand for this cause Ive used it in the past but cant remember it.It wasnt a lisp routine. So I dont want to change the text I want to add to them. eg change 26.50, 28.60 35.35 ect to 26.50m, 28.60m, 35.35m and so on. that is what find/replace will do Quote Link to comment Share on other sites More sharing options...
nelsongrae Posted September 18, 2008 Author Share Posted September 18, 2008 that is what find/replace will do Thanks for the info dbroada, could you show me exactly how, cause it doesnt work for me. What ever you put in the replace part thats what it chages to. So how do you keep the various text numbers in tact while adding the m to the end of each. If I pick say all text eg 26.50, 28.60 35.35 ect when I type replace what do i type to keep these numbers while adding m to them. Quote Link to comment Share on other sites More sharing options...
dbroada Posted September 18, 2008 Share Posted September 18, 2008 unfortunately its a bit heavy handed but pretty much as DVDM suggested. I would QSELECT all text | contents | wildcard | .50 (or similar). Then right click Find & Replace. Select .50 in the find and .50 m in the replace. Quote Link to comment Share on other sites More sharing options...
cadvision Posted September 22, 2008 Share Posted September 22, 2008 This is a very old lisp that I have used for years to add a prefix or/and suffix to text ; TIP908.LSP : ADDTEXT.LSP Add Prefix/Suffix to Text ©1993, Ron Feiro (defun C:ADDTEXT ( / pre suf sset n index el c old new d b2) (setq count 0) (setq pre (getstring 1 "\nEnter text prefix: ")) (setq suf (getstring 1 "\nEnter text suffix: ")) (princ "\nSelect TEXT to change.") (if (setq sset (ssget)) (progn (setq n (sslength sset)) (setq index 0) (repeat n (setq el (entget (ssname sset index))) (setq index (1+ index)) (if (= "TEXT" (cdr (assoc 0 el))) (progn (setq c (assoc 1 el) old (cdr c) new (strcat pre old suf) d (cons (car c) new) b2 (subst d c el) count (1+ count) );setq (entmod b2) );progn nil );if );repeat );progn (princ "\nNo entities were selected.") );if (princ (strcat "\n" (itoa count) " TEXT entities were processed.")) (princ) );defun C:ADDTEXT 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.