AutoCAD/DWG conversions
Expert: Bill DeShawn - 7/19/2006
QuestionI need to convert all of my drawings from .DWG to .DXF. Is it possible to do this all at once, rather than each one individually?
Answer@echo off
cls
FOR %%F IN (*.DWG) DO c:\ADT2004\acad %%F PLOTFIT.SCR
ECHO.
:END
IF NOT EXIST *.DWG DIR .
IF NOT EXIST *.DWG ECHO END OF BATCH FILE
IF NOT EXIST *.DWG PAUSE
Here is a batch file to start with.
It's DOS commands. You need to create a script with the -PLOT command (include the minus sign).
The following is plotfit.scr as named in the batch file.
_zoom
_e
-insert
plotdwg
(getvar "extmin")
(getvar "viewsize")
0
_-plot
_y
Model
HP3200SE.PC3
Letter
Inches
Landscape
No
Extents
Fit
Center
Yes
CHP2K
yes
A
No
No
Yes
_.QUIT
Y
The above script is an example of a script file and how it is written. This one is for plotting to fit on a letter size sheet using a PC3 file and a color dependent plot style name CHP2K.ctb
The combination of batch and script files will allow me to plot an entire folder full of drawings to fit a letter size sheet of paper
A similarly written set can what you want it to do. SAVEAS can be the command. To test the saveas command as a script command you can just do this at the command line:
(command "_.script")
AutoCAD will return the command line options just like it would if it were done in a script file like this:
(load "dwg2dxf)
(c:dwg2dxf)
The above would load a LISP routine named dwg2dxf.lsp and then execute the dwg2dxf function in the routine. I just put that in as an example. I don't have such a routine.
I hope you know something about writing batch file and script files. If not, try to find somebody you work with or go to school with who can help you with that.
You're going to need that to get this done.
There might be another way though.
I found something in the HELP files, but It wasn't very helpful. It didn't really talk about batch processing a script file. What version of AutoCAD are you running?
Bill DeShawn
http://my.sterling.net/~bdeshawn