Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script Files

Status
Not open for further replies.

Hayden

Mechanical
Jul 31, 2002
121
0
0
NZ
Hi,

I know nothing about script files but I think I may be able to use them for a particular thing I do.

I would like to convert multiple dxf to dwg files.

What I would like to do is explained below:

1. Open DXF
2. Zoom to extents
3. Save as DWG
4. Close the file

The quantities of files is always quite high, around 200-400 so an automated method of doing this would be great.

Thanks

Hayden
 
Replies continue below

Recommended for you

Hi,

I think I answered you before on a similar topic but here goes.

If you can write a script to convert one drawing from DXF to DWG...you can then apply that script (as well as others)
to many drawings, using a FREEWARE program found at the following web site:
It was written exactly for the uses you described.

Regards,
 
Thanks MyCad2,

I Have started using ezscript and think it's great. I know nothing about scripts though. Do you know if yu can place boolean statements (if, then...) throughout the script?
 
I think EZscript-Pro is great too.

To answer your question, you cannot do For...Next loops in an AutoCAD script, but you can in a LISP routine which EZscript-Pro also supports.

The key to using EZscript-Pro is to get your script/LISP to run inside autocad first, then load it into EZscript-Pro for operation on many drawings.

Alternately you can repeatedly call the same script (slightly modified each time))to operate on a drawing(s).

As to your earlier post, I will post a script that will open a DXF..plot it..then save it as a .dwg file.

Regards,
 
Here is a script that will open a .dxf, plot it, then save it as a .dwg file. Use it with EZscript-Pro.

zoom e
-plot
y
Model
(INSERT PRINTER NAME HERE)
(INSERT PAPER SIZE HERE)
I
L
N
e
F
center
Yes
.
n
n
n
y
y
_saveas
r13
Space
Space

Don't forget the spaces at the end. They act the same as the ENTER key.

EZscript-Pro will add the open and close statement..do not add them to your script. After clicking the "make script" button, the resulting script that will run on AutoCAD will be c:\ezscript\ezscript.scr.

Regards,
 
Before you convert DXF into DWG you must use the NEW command in your script (don't forgot the period)
, this is nesseserly to import all entity's from the DXF, and keep in mind that long file names must have double quote's around it. If you useing a2000 or higher set the SDI(Single Document Inerface) enviroment to 1 before you start, to ensure processing one file at the time.

Example script:

FILEDIA 0
NEW .
OPEN "dxf long file name"
ZOOM E
SAVE

Enjoy [thumbsup2]

P.S.
I have this home made routine VBA, send me your email and I posted to you.
 
Status
Not open for further replies.
Back
Top