PDA

View Full Version : Batch routine to open dwg files that are zipped!!



Jgoduti25
2014-01-10, 04:08 PM
Alright I have a simple batch/scr/lisp routine that opens cad files runs a purge routine on them, saves and quits. My issue is that my company loves to unnecessarily zip every single dwg file. Is there a possible way to have my routine open the zipped dwg files and run the same process I already have in place?

Thanks for any help!! :lol:

Opie
2014-01-10, 05:09 PM
My issue is that my company loves to unnecessarily zip every single dwg file.
Really? I don't think I even want to know the rationale for that workflow.


Is there a possible way to have my routine open the zipped dwg files and run the same process I already have in place?

Thanks for any help!! :lol:

How do you currently open the drawings? How do you zip them after you modify them?

You could possibly invoke this through the shell.application object. There is some vbscript code (http://stackoverflow.com/questions/911053/how-to-unzip-a-file-in-vbscript-using-internal-windows-xp-options-in) out there that shows how to extract files from a zip file.

Jgoduti25
2014-01-10, 06:21 PM
How do you currently open the drawings? How do you zip them after you modify them?


I use a batch routine to open autocad and then a .dwg file. I need it to open the zip file then the dwg then run my lisp.

we use winzip.

Hmm I also do not need to extract the file. Im starting to think this not only doesnt make sense to a normal person haha but cant be done.
here is the processs basically im looking for.

Open Autocad
Open "filename" using winzip
Open "*.dwg"
run lisp
save
quit

I have most of this working successfully. I just need the zip part.

bhull1985403354
2014-01-13, 09:19 PM
I believe you can do this via a .bat file.
Here's an example (save this in notepad as a .bat) and double click, after having changed the paths within to the correct paths on your machine.


FOR %%f in ("C:/YourFolder/Folder/SubDir/*.dwg") do start /wait C:\"Program Files"\Autodesk\"AutoCAD Mechanical 2012"\acad.exe "%%f" /b "C:/YourDir/SubDir/AUTOCADSCRIPT.scr"

In conjunction with information from the following link:
http://kb.winzip.com/kb/entry/125/

Have fun!