Jump to content

Find and Replace


gil9166

Recommended Posts

I just want to replace the attribute or text using find and replace command. example: FINDthis numbers 1, 2, 3, 4, 5,... and RELACE it by P1, P2, P3, P4, P5..., like adding letters on each separate number.

Cause I use to change them one at a time, these are note numbers inside a block or sometimes like a buble grid.

 

thanks,

gil

Link to comment
Share on other sites

if I'm reading your request correctly this is not easy. If you were to use the FIND & REPLACE function to change 1 to P1 that would change 11 to P1P1, not what you want.

 

I think your best approach would be a LISP that prefixes every selected text with P. You will either have to select each item but that is still easier than doing by hand.

 

If some guidance doesn't arrive here soon request help in the LISP section. Just adding a request to an old thread doesn't always get picked up - it looks like it has already been answered.

 

also look below for other threads - this may already have been answered

Link to comment
Share on other sites

A quick Text prefixer:

 

(defun c:ptxt (/ ss str)
 (vl-load-com)
 (if (and (setq ss (ssget '((0 . "*TEXT"))))
          (setq str (getstring t "\nSpecify Prefix: ")))
   (mapcar
     (function
       (lambda (x)
         (vla-put-TextString x
           (strcat str (vla-get-TextString x)))))
     (mapcar 'vlax-ename->vla-object
       (vl-remove-if 'listp
         (mapcar 'cadr (ssnamex ss))))))
 (princ))

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