Page 1 of 1

SaveAsDWG() exports 10 times bigger file size

Posted: 05 Feb 2021, 08:11
by Sing
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.

Re: SaveAsDWG() exports 10 times bigger file size

Posted: 05 Feb 2021, 08:35
by support
Hello Sing,

You didn't attach the before.dwg file.

Mikhail

Re: SaveAsDWG() exports 10 times bigger file size

Posted: 05 Feb 2021, 13:40
by Sing
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.

Re: SaveAsDWG() exports 10 times bigger file size

Posted: 09 Feb 2021, 06:46
by support
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

Re: SaveAsDWG() exports 10 times bigger file size

Posted: 10 Feb 2021, 08:55
by Sing
Oh~ I get it.
Thank you for your reply.

Re: SaveAsDWG() exports 10 times bigger file size

Posted: 15 Feb 2021, 14:16
by Sing
Hello Mikhail

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

Re: SaveAsDWG() exports 10 times bigger file size

Posted: 19 Feb 2021, 13:59
by support
Hello Sing,

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

Mikhail

Re: SaveAsDWG() exports 10 times bigger file size

Posted: 23 Feb 2021, 13:47
by Sing
I see. Thank you Mikhail.