CADtoDWG.SaveAsDWG -> Exception Error
Posted: 26 Jan 2024, 18:36
I have written a small amount of test code to simply open a DWG file and then save it - Essentially making a copy. I wanted to ensure that I am not causing any issue by editting the file, so it's very simple:
I am using .NET (version 8.0) windows forms with CAD.NET 15.0.0.57290.
When I call this function, the following error is presented:
Code: Select all
void SaveFile()
{
CADImage cadImage = CADImage.CreateImageByExtension(selectFile.FileName);
cadImage.LoadFromFile(selectFile.FileName);
CADtoDWG.SaveAsDWG(cadImage, Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "output.dwg"));
}
When I call this function, the following error is presented:
It's a shame, because the library has some great tools - But I cannot save the file. Is there a known issue around saving .DWG files?The type initializer for 'CADImport.Export.CADExportFrame' threw an exception.