Change Thumbnail background for Content Center generated parts

Change Thumbnail background for Content Center generated parts

Colbjørn
Enthusiast Enthusiast
1,299 Views
3 Replies
Message 1 of 4

Change Thumbnail background for Content Center generated parts

Colbjørn
Enthusiast
Enthusiast

Hi.

 

If you have an iPart in your Content Center that changes shape depending on your iPart selection.

 

You can update the BOM Thumbnail with the following iLogic rule.

Make an iLogic rule that triggers Before Save and the following code will updated the BOM Thumbnail even for Content Center parts:

ThisDoc.Document.SetThumbnailSaveOption (ThumbnailSaveOptionEnum.kActiveWindowOnSave)

But how do you change the Thumbnail Background color?

Because ThisApplication, does not give you access to the Application Object that generates the Content Center part.

 

The following code does not work when the part is generated from the Content Center:

ThisApplication.ColorSchemes.Item("Presentation").Activate
ThisApplication.ColorSchemes.BackgroundType = BackgroundTypeEnum.kOneColorBackgroundType

Changing your background color before you generate the part does not change the background color for the Content Center part.

The Content Center part is generated with some default settings, that is not affected by your current settings in the application.

 

 

Colbjørn.

0 Likes
Accepted solutions (2)
1,300 Views
3 Replies
Replies (3)
Message 2 of 4

Xun.Zhang
Alumni
Alumni

Hi Colbjørn,

 

Yes, the background color is follow system color setting. Try to go to application option -> Color and select a color scheme, the thumbnail background will up to date once save it.

 

Hope it helps a little bit.


Xun
Message 3 of 4

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi @Colbjørn,

 

As mentioned you need to save the file to set the thumbnail. Here is a quick iLogic routine to do this.

 

Also just as a tip, you can search and ask programming questions of this type on the Inventor Customization forum:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

oDoc = ThisApplication.ActiveEditDocument

'get current colorcheme name 
oColorScheme = ThisApplication.ActiveColorScheme.Name

'Change to Presentation
ThisApplication.ColorSchemes.Item("Presentation").Activate

'set iproperty to use ISO view on save
oDoc.SetThumbnailSaveOption _
(ThumbnailSaveOptionEnum.kActiveComponentIsoViewOnSave)

'save the file
oDoc.Save

'Change back to original scheme
ThisApplication.ColorSchemes.Item(oColorScheme).Activate 

EESignature

Message 4 of 4

Colbjørn
Enthusiast
Enthusiast
Accepted solution

Hi.

 

Using the following code gives you access to the Application Object during the part generation from The Content Center.

ThisServer.ColorSchemes.Item("Presentation").Activate
ThisServer.ColorSchemes.BackgroundType = BackgroundTypeEnum.kOneColorBackgroundType

This didn't solve my "problem" but it answered my question.

 

Colbjørn.

0 Likes