×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Script Files

Script Files

Script Files

(OP)
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

RE: Script Files

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: http://www.ezscriptpro.com

It was written exactly for the uses you described.

Regards,

RE: Script Files

(OP)
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?

RE: Script Files

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,

RE: Script Files

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,

RE: Script Files

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

P.S.
I have this home made routine VBA, send me your email and I posted to you.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources