save dwg by hand has thumbnail, but saveas side db by code, no thumbnai?

save dwg by hand has thumbnail, but saveas side db by code, no thumbnai?

swaywood
Collaborator Collaborator
237 Views
1 Reply
Message 1 of 2

save dwg by hand has thumbnail, but saveas side db by code, no thumbnai?

swaywood
Collaborator
Collaborator

I read a side db , and save it, but there is no thumbnail created.

 

when i open the file by hand, after saving file, there is a new thumbnail shown in open dialog.

 

the following is my code, does't work

 

I find a link, maybe has solution, but i  can not open it.

can anyone help me to paste the code to this post?

thanks.

 

            using (Database dbInsert = new Database(false, true))
            {
              dbInsert.ReadDwgFile(sDwg, System.IO.FileShare.ReadWrite, true, null);
              DatabaseExtension.Audit(dbInsert, true, true);
              dbInsert.RetainOriginalThumbnailBitmap = true;
              dbInsert.SaveAs(sDwg, true, DwgVersion.AC1027, dbInsert.SecurityParameters);
            }

 

0 Likes
238 Views
1 Reply
Reply (1)
Message 2 of 2

ActivistInvestor
Mentor
Mentor

You just need to insert the following line into your code before it calls SaveAs():

 

db.RetainOriginalThumbnailBitmap = true;

 

Where 'db'  is the variable in your code, which the Database is assigned to. 

0 Likes