Function ColorSchemes.Activate() changes IconsColor to Cobalt

Function ColorSchemes.Activate() changes IconsColor to Cobalt

arsenii_yavtushenko
Contributor Contributor
420 Views
2 Replies
Message 1 of 3

Function ColorSchemes.Activate() changes IconsColor to Cobalt

arsenii_yavtushenko
Contributor
Contributor

Hello,

 

I want to create a code that will change the background on each of the parts in assembly to white. I decided to do it by changing the background to white and then opening each file in assembly and saving it.

 

The problem is that when I use a demo code below, it also changes the Icons' Color Theme to Cobalt. The problem is that, for some reason, it takes an insane amount of time, especially if I will try to change it back.

 

Sub Test()
ThisApplication.ColorSchemes.Item(7).Activate() 'That is when it changes Icons' appearance ThisApplication.ColorSchemes.BackgroundType = kOneColorBackgroundType ThisApplication.ColorSchemes.IconsColor = kAmberColorTheme 'That is how I change it back End Sub

 

The interesting part is that ColorSchemes.Activate() will work almost instantly is the icons are already Cobalt. It sparked an idea that this rub may lie in the Color Scheme's options, yet I wasn't able to find even a trace of it neither in the API documentation nor in the Color Scheme Editor.

 

So there are two questions - why this code changes Icons' appearance, and how to work around that?

 

Any help is appreciated, thank you!

0 Likes
421 Views
2 Replies
Replies (2)
Message 2 of 3

YuhanZhang
Autodesk
Autodesk

Can you tell which Inventor version you reproduced this problem? 



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes
Message 3 of 3

arsenii_yavtushenko
Contributor
Contributor

Hello,

 

Thank you for the response!

I am using Inventor 2016, but the same issue is present in Inventor 2014..

0 Likes