AutoCAD/DWG conversions

Advertisement


Question
I 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

AutoCAD

All Answers


Answers by Expert:


Ask Experts

Volunteer


Bill DeShawn

Expertise

I can address all 2-D questions and some 3-D questions. I do programming in AutoLISP if it doesn`t involve solid modeling. I can also address menu customization issues and can help you find answers to questions I can`t answer by taking your question directly to Autodesk via their newsgroups.

Experience

I used to do electronic and mechanical design for a flat panel monitor manufacturer, and now I do architectural drafting for an architect. I did and do AutoLISP and menu customization and take pride in making my lisp routines to do the work exactly the way the client likes them done.

Publications
I had a routine published in CADENCE magazine (no longer in publication and taken over by CADALYST). Some of my routines are published on my website at http://my.sterling.net/~bdeshawn

©2012 About.com, a part of The New York Times Company. All rights reserved.