Jump to content

Recommended Posts

Posted

does anyone know of a way to substitute the contents of a text throughout the drawing easily? What I want to do is substitute all existing elevations in the drawing with the same contents, but enclosed in parentheses, so that: xxx.xx becomes (xxx.xx)

Posted

I've done that very thing. Select the text you want to change. Use the Edit|Find command. For find text, put * (wild card). For replace, put (*) (parentheses around wild card). That's it.

Posted

this didn't work. when i use the find/replace function on say, 123.45, and doing as you said, the result i get is literally (*). it appears that it interprets the wildcard character as an asterisk

Posted

To do the entire drawing....

 

Edit>Find or _FIND on the command line.

Posted

i'm sorry. i haven't explained properly.

 

in a drawing, there are many text strings containing a numerical value. i want to change all the text strings with a single command or series of commands (without having to individually change them one by one) so that the original values are retained, but the numbers (numeric text string) are now enclosed inside parentheses.

 

for example: 123.45 becomes (123.45), 543.21 becomes (543.21), 234.56 becomes (234.56), etc.

Posted

I expect you would have to use wildcards between the parenthesis. Not sure AutoCAD's FIND command can handle it.

  • 2 weeks later...
Posted (edited)

I have a very old lisp that I use for this. It is called addtxt.lsp and is for adding prefix & suffix to text strings. I used it as you want for doing wire numbers in schematics for the past 20 yrs (give or take)

 

Think it was an old cadence magazine file

 

; TIP908.LSP : ADDTEXT.LSP Add Prefix/Suffix to Text   (c)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

Edited by SLW210
ADDED TAGS!!!
  • 7 months later...
Posted

AutoCAD used to have a command in the EXPRESS tools that was: Edit Any Text (ie. you could select MTEXT, TEXT and in multiple places in the current drawing) Once you selected all of the text to be edited, you hit ENTER and the command would go through each text entity, with the appropriate editor, in the order that you made your selection. This was available in ACAD 06 but I haven't seen it since. Does anyone know if it's still available or a suitable replacement?

 

I just thought about this today and knew this would be the place to ask. I did a search of the forum but came up empty handed so I thought I'd bump this one.

 

Let me know! Thanks.

Posted

I also have this issue, but I just quit lastly. I will try some methods which seems feasible and hope find a suitable way for me.

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...