Find and Replace, Wildcards, Multiple Drawings

Find and Replace, Wildcards, Multiple Drawings

tstorzuk
Advocate Advocate
6,470 Views
21 Replies
Message 1 of 22

Find and Replace, Wildcards, Multiple Drawings

tstorzuk
Advocate
Advocate

A bit of help please, all you CAD Guru's;

 

I've got a couple hundred drawings that I need to replace some text that resides within various blocks. There are various possible combinations of what the text might be;

EL.###'-## ##/##"
EL.###'-## #/##"
EL.###'-## #/#"
EL.###'-##"
EL.###'-# ##/##"
EL.###'-# #/##"
EL.###'-# #/#"
EL.###'-#"
EL.##'-## ##/##"
EL.##'-## #/##"
EL.##'-## #/#"
EL.##'-##"
EL.##'-# ##/##"
EL.##'-# #/##"
EL.##'-# #/#"
EL.##'-#"

 

I need to replace any of these possibilities with nothing (make it completely blank).

 

I've read up on Lee Mac's Batch Find Replace, but it stipulates that it doesn't work with wildcards.

I've read up on JTB Batch Change that's available in the Autodesk store, but it's not worth $150USD to me. Plus it looks way too complicated for me to want to figure out how to use it.

 

Is there another possible option out there that any of you know about? Or some other solution that I'm overlooking?

 

Thanks in advance for your help!

0 Likes
Accepted solutions (1)
6,471 Views
21 Replies
Replies (21)
Message 21 of 22

tstorzuk
Advocate
Advocate

I couldn't get that to run.....

 

I then tried to modify Rperez's code to this, and couldn't get it to run either;

;;; Remove EL.xxxxxxx and replace with EL. FIELD
;;; Load Lee Mac's Batch program to run on multiple files all at once
;;; http://www.lee-mac.com/odbxbase.html
(defun c:replaceell (/ replaceelevs) ;;;renamed from test to replaceell
  (defun replaceelevs (doc) ;;;renamed from deleteelevs to replaceelevs
    (vlax-for a	(vla-get-blocks doc)
      (if (wcmatch (vla-get-name a) "block*")
	(vlax-for b a
	  (and (vlax-write-enabled-p b)
	       (vlax-property-available-p b 'textstring)
	       (wcmatch (vla-get-textstring b) "EL.*'-*\"")
	       (vla-replace b "EL. FIELD") ;;;I tried revising this line;;;
	  )
	)
      )
    )
    (princ)
  )
  (lm:odbx 'replaceelevs nil t) ;;;renamed from 'deleteelevs to 'replaceelevs
  (princ)
)
(vl-load-com)
0 Likes
Message 22 of 22

tstorzuk
Advocate
Advocate

It keeps spitting out this;

 

ActiveX Server returned the error: unknown name: Replace

0 Likes