.NET

Reply
Contributor
dip_nik
Posts: 18
Registered: ‎11-26-2007
Message 1 of 6 (506 Views)

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

506 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*
_gile
Posts: 2,082
Registered: ‎04-29-2006
Message 2 of 6 (506 Views)

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
dip_nik
Posts: 18
Registered: ‎11-26-2007
Message 3 of 6 (506 Views)

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*
_gile
Posts: 2,082
Registered: ‎04-29-2006
Message 4 of 6 (506 Views)

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
kviler
Posts: 4
Registered: ‎10-18-2009
Message 5 of 6 (506 Views)

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
dip_nik
Posts: 18
Registered: ‎11-26-2007
Message 6 of 6 (506 Views)

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.
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.