.NET

.NET

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

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

522 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,125
Registered: ‎04-29-2006
Message 2 of 6 (522 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 (522 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,125
Registered: ‎04-29-2006
Message 4 of 6 (522 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 (522 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 (522 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.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.