Page 1 of 1
SaveAsDWG() Failure
Posted: 06 Jul 2021, 11:29
by Sing
Hello
I found a .dwg file that is not saved.
Could you please check why the method SaveAsDWG() returns false?
http://magzog.com/input.zip
Code: Select all
string filepath = @"../input.dwg";
var cadImage = CADImage.CreateImageByExtension(filepath);
cadImage.LoadFromFile(filepath);
if(CADImport.Export.CADtoDWG.SaveAsDWG(cadImage, "output.dwg"))
{
;
}
else
{
;
}
Thank you.
Re: SaveAsDWG() Failure
Posted: 06 Jul 2021, 17:00
by support
Hello Sing,
Unfortunately, the link
http://magzog.com/input.zip is broken. Please check it.
Mikhail
Re: SaveAsDWG() Failure
Posted: 07 Jul 2021, 13:20
by Sing
Oh~ I missed the directory name.
This is the correct link.
http://magzog.com/caddotnet/input.zip
Thank you.
Re: SaveAsDWG() Failure
Posted: 08 Jul 2021, 20:27
by support
Hello Sing,
Thank you for the file.
We have reproduced the problem. The method SaveAsDWG() returns false and doesn't create the output .dwg file, and the DXF export generates an invalid DXF file which gives the following error when opening it with DWG TrueView:
Code: Select all
The following error was encountered while reading
in LINE starting at line 83332:
Bad color index -8
Invalid or incomplete DXF input -- drawing discarded.
So apparently the problem is connected with Bad color index -8. I have forwarded your DWG file to CAD .NET development team for further investigation.
Mikhail
Re: SaveAsDWG() Failure
Posted: 10 Jul 2021, 12:12
by Sing
Hello Mikhail
Thank you so much. I will also check if the person made it used some AutoCAD plugin.
After investigation please let me know. It would be useful for us.
Thank you again.
Re: SaveAsDWG() Failure
Posted: 12 Aug 2021, 12:59
by support
Hello Sing,
The problem is fixed in sgcadexp.dll which comes with the latest build of CAD .NET (14.1.0.49115). You can download the latest build at this page:
https://cadsofttools.com/products/cad-net/download/.
Mikhail