SaveAsDWG() Failure

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
Sing
Posts: 48
Joined: 12 Apr 2020, 17:39

SaveAsDWG() Failure

Post by Sing » 06 Jul 2021, 11:29

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.

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Re: SaveAsDWG() Failure

Post by support » 06 Jul 2021, 17:00

Hello Sing,

Unfortunately, the link http://magzog.com/input.zip is broken. Please check it.

Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Sing
Posts: 48
Joined: 12 Apr 2020, 17:39

Re: SaveAsDWG() Failure

Post by Sing » 07 Jul 2021, 13:20

Oh~ I missed the directory name.
This is the correct link.
http://magzog.com/caddotnet/input.zip

Thank you.

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Re: SaveAsDWG() Failure

Post by support » 08 Jul 2021, 20:27

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
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Sing
Posts: 48
Joined: 12 Apr 2020, 17:39

Re: SaveAsDWG() Failure

Post by Sing » 10 Jul 2021, 12:12

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.

support
Posts: 3254
Joined: 30 Mar 2005, 11:36
Contact:

Re: SaveAsDWG() Failure

Post by support » 12 Aug 2021, 12:59

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
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply