You can use database API “DxfOut” to export/save the drawing as DXF file. Below simple code shows the procedure to save the current drawing to various versions of DXF
DwgVersion.AC1021 – for AutoCAD 2007 version
DwgVersion. AC1800– for AutoCAD 2004 version
DwgVersion. AC1015 – for AutoCAD 2000 version
DwgVersion. AC1009 – for AutoCAD R12 version
[CommandMethod("SaveDxfFile")]
public static void SaveDxfFile()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Database db = doc.Database;
//save as R12 version dxf
//db.DxfOut("c:\\temp\\test.dxf", 16, DwgVersion.AC1009);
//save as 2000 version dxf
//db.DxfOut("c:\\temp\\test.dxf", 16, DwgVersion.AC1015);
//save as 2004 version dxf
//db.DxfOut("c:\\temp\\test.dxf", 16, DwgVersion.AC1800);
//save as 2007 version dxf
db.DxfOut("c:\\temp\\test.dxf", 16, DwgVersion.AC1021);
}