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

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

Anonymous
Not applicable
1,760 Views
5 Replies
Message 1 of 6

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

Anonymous
Not applicable
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
0 Likes
1,761 Views
5 Replies
Replies (5)
Message 2 of 6

_gile
Consultant
Consultant
Hi,

Look at the Database.DxfOut() method.


Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 3 of 6

Anonymous
Not applicable
Hi gile,

Thanks for reply,

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

Database.DxfOut(path, 1, true);

Thanks,
0 Likes
Message 4 of 6

_gile
Consultant
Consultant
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
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 5 of 6

Anonymous
Not applicable
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
0 Likes
Message 6 of 6

Anonymous
Not applicable
hi kviler,

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

Have a nice day.
0 Likes