Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Updating Thousands of Blocks in mutliple subfolders - looking for easy routine

4 REPLIES 4
Reply
Message 1 of 5
johnw
405 Views, 4 Replies

Updating Thousands of Blocks in mutliple subfolders - looking for easy routine

Good evening all,

 

I have to update a block in literally thousands of cad files. I have the book "AutoCAD Secrets Every User Should Know About" and the author gives examples of this by using a Batch File, Script File, and then Lisp Routine. I was wondering if anyone had an easier way to do the following:

 

Insert "Gennnotes=" (updating the block) into any drawing that has this block in the drawing already, if not Quit.

 

Typically to do this I would open the drawing "insert" "gennotes=", then cancel the command and save the drawing.

 

I have a lot of subfolders that also hold drawings so the command would have to search through each subfolder for dwgs.

 

Like I mentioned above, I tried to use the Batch File/Script Method but my batch file failed. It could find the folder Autocad 2012 - English. For some reason it was not seeing the spaces in between. Not sure. Here's the batch file portion of the routine:

 

Batch file:

 

For /r C:\Sybex\ %%f in (c:\sybex\*.dwg) do start /wait
C:\ACAD2012\Autocad 2012 - English\acad.exe "%%f" /b
C:\gennotesupdate.scr

 

Any help would be appreciated.

 

John W.

4 REPLIES 4
Message 2 of 5
hmsilva
in reply to: johnw

johnw,
the line C:\ACAD2012\Autocad 2012 - English\acad.exe does not work in a batch file, because it contains empty spaces,
You need to put double quotes around the path that has spaces like this:

 

"C:\ACAD2012\Autocad 2012 - English\acad.exe"


Hope that helps

Henrique

EESignature

Message 3 of 5
johnw
in reply to: hmsilva

I was able to get Autocad to open using the batch file modifcation per your instructions:


FOR /r %%f in (c:\sybex\dwg\*.dwg) DO START /WAIT
C:\"ACAD2012"\"Autocad 2012 - English"\acad.exe "%%f" /b C:\sybex\wbout.scr

 

Except when Autocad loads it says "File cannot be found" so something is wrong with my wildcard reference and I can't see what's wrong.

 

Any suggestions?

Message 4 of 5
hmsilva
in reply to: johnw

johnw,
write batch file this way

 

FOR /r c:\sybex\dwg\ %%f in (*.dwg) DO START /WAIT
"C:\ACAD2012\Autocad 2012 - English\acad.exe" "%%f" /b
C:\sybex\wbout.scr


Henrique

EESignature

Message 5 of 5
pbejse
in reply to: johnw


@Johnw wrote:

Good evening all,

 

Insert "Gennnotes=" (updating the block) into any drawing that has this block in the drawing already, if not Quit.

 

Typically to do this I would open the drawing "insert" "gennotes=", then cancel the command and save the drawing.

 

 John W.


Just a heads up, invoking a cancel would also terminate the script.

 

Also i would sugest you use ODBX for faster processing, but you need to throw  Insert "Gennnotes=" approach out the window. try and search this forum for REDEFINE block and look for one that doesnt use the insert command approach. i wrote one before but i cant seem to find it myself. Smiley Very Happy

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost