.NET

.NET

Reply
Contributor
18 Posts
0 Kudos
Registered: ‎11-26-2007
Post 1 of 6

How to convert a .DWG file into .DXF file.

534 Views, 5 Replies
02-02-2010 01:58 AM
Good afternoon All,

How to convert a .dwg file into .dxf file.
or
How to save as a .dwg file into new .dxf file.

Thanks
*Expert Elite*
2,142 Posts
255 Kudos
Registered: ‎04-29-2006
Post 2 of 6

Re: How to convert a .DWG file into .DXF file.

02-02-2010 04:04 AM in reply to: dip_nik
Hi,

Look at the Database.DxfOut() method.
Gilles Chanteau
Contributor
18 Posts
0 Kudos
Registered: ‎11-26-2007
Post 3 of 6

Re: How to convert a .DWG file into .DXF file.

02-02-2010 05:11 AM in reply to: dip_nik
Hi gile,

Thanks for reply,

i tried this but it is not converting to DXf see below code

Database.DxfOut(path, 1, true);

Thanks,
*Expert Elite*
2,142 Posts
255 Kudos
Registered: ‎04-29-2006
Post 4 of 6

Re: How to convert a .DWG file into .DXF file.

02-02-2010 05:48 AM in reply to: dip_nik
Hi,

Database is a class.
I was meaning the DxfOut() method of the Database class.
You have to create an instance of the the Database class of the Document you want to convert to DXF and call the DxfOut() method for this instance.

Assuming you want to convert the active document:

{code}Document doc = Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
db.DxfOut(path, 1, true);{code}
Gilles Chanteau
Member
4 Posts
0 Kudos
Registered: ‎10-18-2009
Post 5 of 6

Re: How to convert a .DWG file into .DXF file.

02-08-2010 04:17 AM in reply to: dip_nik
Hello

Don't forget to put the DxfOut() call inside a transaction otherwise some strange behavior will occur. Also, you might consider using a higher value for precision (second argument).

PK


{code}
Dim doc As Document = Application.DocumentManager.MdiActiveDocument
Dim db As Database = doc.Database

Dim tr As Transaction = db.TransactionManager.StartTransaction()
Using (tr)
db.DxfOut(FileName, 10, True)
End Using
{code} Edited by: kviler on Feb 8, 2010 1:21 PM
Contributor
18 Posts
0 Kudos
Registered: ‎11-26-2007
Post 6 of 6

Re: How to convert a .DWG file into .DXF file.

03-16-2010 10:24 PM in reply to: dip_nik
hi kviler,

i forgot to say thanks a lot it working fine.
sorry to delay
thanks again

Have a nice day.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!