SaveAsDWG() exports 10 times bigger file size

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

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

SaveAsDWG() exports 10 times bigger file size

Post by Sing » 05 Feb 2021, 08:11

Hello

I found something strange today.
The thing is that
SaveAsDWG() exports and saves 10 times a bigger file size than the original one even though nothing did except load and save. It takes quite along. Loading time takes about 5 seconds, and saving time takes more than 10 sec.

And then, open the output file 'after.dwg' in AUTOCAD and save it.
The file size is changed back to the original file size.

My code is below.

Code: Select all

string filepath = "before.dwg";  // about 3 MB
var cadImage = CADImage.CreateImageByExtension(filepath);
cadImage.LoadFromFile(filepath);

CADImport.Export.CADtoDWG.SaveAsDWG(cadImage, "after.dwg");   // about 30 MB
I attached the 'before.dwg' file.

Tested version
------------------------------------------
CADImport.dll
------------------------------------------
14.1.0.40930
14.1.0.45509
14.1.0.47042
------------------------------------------
sgcadexp.dll
------------------------------------------
29th of Apr, 2020
31st of Jan, 2020
------------------------------------------

Thank you.

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

Re: SaveAsDWG() exports 10 times bigger file size

Post by support » 05 Feb 2021, 08:35

Hello Sing,

You didn't attach the before.dwg file.

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() exports 10 times bigger file size

Post by Sing » 05 Feb 2021, 13:40

Oh... Sorry.

I got an error message ' Sorry, the board attachment quota has been reached.'.

Please download the file by the below link.
(Copy the link address, paste it on the address bar of web-browser, and then press key enter.)

http://magzog.com/saveasdwg/before.dwg

Thank you.

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

Re: SaveAsDWG() exports 10 times bigger file size

Post by support » 09 Feb 2021, 06:46

Hello Sing,

Thank you for the file.

Please note that the SaveAsDWG method exports to DWG 2000 file format. If you try to convert your file to DWG 2000 using, for example, Autodesk DWG TrueView 2018, it will export a .dwg file of the size 30 MB.

Try to convert your file to DWG 2000 using AutoCAD and compare results.

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() exports 10 times bigger file size

Post by Sing » 10 Feb 2021, 08:55

Oh~ I get it.
Thank you for your reply.

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

Re: SaveAsDWG() exports 10 times bigger file size

Post by Sing » 15 Feb 2021, 14:16

Hello Mikhail

Is there a way to convert from CADImage to .dwg file with a higher version than DWG 2000?

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

Re: SaveAsDWG() exports 10 times bigger file size

Post by support » 19 Feb 2021, 13:59

Hello Sing,

Unfortunately, the SaveAsDWG method doesn't allow to specify DWG version for export.

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() exports 10 times bigger file size

Post by Sing » 23 Feb 2021, 13:47

I see. Thank you Mikhail.

Post Reply