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.
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
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?
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
@Anonymous 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.