Page 1 of 1

Export as DWG

Posted: 03 Jul 2019, 10:48
by gogoalshop
Hi all,

This is JoJo and i am new here, so i hope i didn't post this question at the wrong part of forum (if i did please let me know).

Question is:
Is it possible with CADImport library opened .dwg files edit and then save as a new .dwg file? It looks like it only allows saving as picture format (.jpg, .bmp...) and as .dxf.

Thanks ahead!!!

Re: Export as DWG

Posted: 03 Jul 2019, 19:45
by support
Hello JoJo,

CAD .NET (CADImport.dll) library supports the DWG export through an additional dynamic link library sgcadexp.dll which is installed with CAD .NET and can be found in the following folders:

c:\Users\USER_NAME\Documents\CAD .NET 14\bin\DWGExportLib\Win32\
c:\Users\USER_NAME\Documents\CAD .NET 14\bin\DWGExportLib\Win64\


To export a CADImage object to a DWG file, you need to copy the file sgcadexp.dll to the folder with CADImport.dll and call a static method CADtoDWG.SaveAsDWG. For example:

Code: Select all

public static void SaveCADImageAsDWG(CADImage cadImage, string dwgFilePath)
{
    CADImport.Export.CADtoDWG.SaveAsDWG(cadImage, dwgFilePath);
}
Note: when you run a solution for Any CPU platform on 64-bit Windows, the DWG export requires sgcadexp.dll from the \DWGExportLib\Win64\ folder.

Mikhail