Code to disable save preview picture option

Code to disable save preview picture option

K.TRYFONIDIS
Advocate Advocate
357 Views
4 Replies
Message 1 of 5

Code to disable save preview picture option

K.TRYFONIDIS
Advocate
Advocate

Hello everyone,

 

I have an idea that may help a lot of people overcome the problem with the thumbnails in bom.

At this moment i have a code that sets the background to white then open all parts and saves them with the white background. ( got the code from @Curtis_Waguespack https://forums.autodesk.com/t5/inventor-forum/is-there-a-way-to-refresh-all-thumbnails/m-p/11073899#... )

It works until you save again the file manually, then it will get the background you have at that moment.


I am wondering, what if there was a code to run through all files ( .iam and .ipt ) and disable the save preview picture on top assembly.

KTRYFONIDIS_0-1674203042033.png


So the order would be like that:

1) Run the code to get white background
2) Run the code and disable massively the save preview picture option afterwards then the white background thumbnail should be always there. ( if something is different run again the step 1 )

So anyone has a code for this?

Of course would help if Autodesk could implement a globally option to turn on and off instead of us running codes for simple things.

 

0 Likes
358 Views
4 Replies
Replies (4)
Message 2 of 5

Michael.Navara
Advisor
Advisor

What you are looking for is Document.SetThumbnailSaveOption Method

You can also set fixed image as preview.

0 Likes
Message 3 of 5

K.TRYFONIDIS
Advocate
Advocate

Ok but when you run this command it enables or disables the Checkbox? 
Shouldn't be something true or false for enable/disable?

0 Likes
Message 4 of 5

Michael.Navara
Advisor
Advisor

I send you a link to documentation of this function. If you want to use it, you need to pass correct arguments. The first one is of type ThumbnailSaveOptionEnum.

This argument specify, how Inventor handles the thumbnail creation. If you want to disable the thumbnail creation, pass the 'kNoThumbnail' value as the first argument.

 

 

0 Likes
Message 5 of 5

K.TRYFONIDIS
Advocate
Advocate

Ok yes i read the link now.

What about re-enabling the checkbox ?

'kyesThumbnail' ?

0 Likes