ColorSchemeIndex = 0 is application of themes completely turned off on shape?

Started by Visisthebest, February 09, 2023, 01:02:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Visisthebest

For turning off Themes, in Visio 2019/2021 I cannot find this option anymore:
https://superuser.com/questions/1109937/how-can-i-remove-a-theme-from-one-shape-of-many-in-visio-2016

However I did stumble on to this different turn-off-the-theme-on-a-shape option, from the documentation from the ISTHEMED() SS function, I understand that setting ColorSchemeIndex = 0 (in the Theme section of the SS), a theme can be completely turned off on a shape.

This works fine and turns off more than just the colors of a theme (also the other styling).

I wonder if this has performance benefits for large diagrams, just completely turning off Themes on shapes that don't need them. Not having to process a shape for where to apply a theme conceivably saves significant CPU time.
Visio 2021 Professional

Surrogate

Quote from: Visisthebest on February 09, 2023, 01:02:31 PMHowever I did stumble on to this different turn-off-the-theme-on-a-shape option, from the documentation from the ISTHEMED() SS function, I understand that setting ColorSchemeIndex = 0 (in the Theme section of the SS), a theme can be completely turned off on a shape.
In which of the cells of the ShapeSheet you use this function?

Surrogate

Quote from: Surrogate on February 09, 2023, 02:09:31 PM
In which of the cells of the ShapeSheet you use this function?
I find answer 8)
Quote from: Visisthebest on February 09, 2023, 01:02:31 PMI wonder if this has performance benefits for large diagrams, just completely turning off Themes on shapes that don't need them. Not having to process a shape for where to apply a theme conceivably saves significant CPU time.
IMHO Themes are evil !!! The best way is not to use them at all.
This picture from my article How to deal with "themes" in MS Visio drawing

wapperdude

This seems to work:  under developer tab> protection => select all the themed entries.

The suggested approach of this topic has a caveat: you need to wrap the value "0" with the guard function.  Note, I only changed the ThemeIndex cell in the shapesheet.
Visio 2019 Pro

wapperdude

A little more investigation reveals:
1)  Locking down the ThemeIndex does not prevent line oriented variations.
2)  To prevent effects changes, the EffectSchemeIndex must also be set to "0".
3)  These changes can be made either in the shape or page shapesheets.
4)  There doesn't seem to be any such entries available in document shapesheet.
5)  Of course there is no such settings at the document level.
Visio 2019 Pro

Visisthebest

Excellent investigation Wapperdude, good idea to use GUARD(0) to protect against those evil themes and good to know EffectSchemeIndex also needs to be set to GUARD(0) to protect shapes against theming a user is trying to force on the shape!
Visio 2021 Professional

Surrogate

Quote from: wapperdude on February 09, 2023, 09:07:43 PM
A little more investigation reveals:
Three years ago I made many attempts to prevent the application of theme effects to my stencils, the sub-shapes they consist of must always be black and white.

  • I set the value 0 in the cells associated with the Theme* in the Protection section.
    Guard(0) also dont works.
  • I set the value 0 in all cells in the Theme properties section.
    Guard(0) also dont works.
  • Even trying to replace the values in the above cells using SETF does not help.
    The visio engine still replaced the values in the cells...
I was helped by the description in this article by Croc.

wapperdude

I was somewhat surprised that setting the lock protection worked.  I vaguely remember that there were issues.  But, now when I tried it those settings did work.   :o  That's why I included a file with my last post.  At a minimum, the file provides a means to check out what may or may not work.   Hopefully I didn't do anything wrong.  Testing was intended to be reasonable, but not exhaustive.  This was done on a 64B, Win11, Home Ed laptop.  I did not check it on Win10,  64B  desktop.

Visio 2019 Pro

Surrogate

Quote from: wapperdude on February 10, 2023, 01:18:55 AMThat's why I included a file with my last post.  At a minimum, the file provides a means to check out what may or may not work.
At my side:
Win10, 64B, Visio 2019 Professional

Line colors are different for different themes: black/grey/brown/etc !

Surrogate

Quote from: Surrogate on February 10, 2023, 09:36:40 AMLine colors are different for different themes: black/grey/brown/etc !
Just modify your shape

Now line color dont changed !!!

Visisthebest

The search for anti-theme teflon settings continues, in the mean time happy with the understanding how to remove theme application off a shape, even if it may be very hard / impossible to prevent a user from reapplying a theme.
Visio 2021 Professional

wapperdude

Fascinating!  I've updated the file to separate the shape based protectionBoth pages have a bent arrow that is drag and dropped.  Same for the 3rd page which uses page settings.  The expectation is the bent arrow will have theme based properties on 1st page, but not on 3rd.

Interesting note to page 3.  I did copy/paste of the 1st page arrow to the 3rd page.  After dropping and arrow still selected, the arrow did respond to page changes.  I do not believe the new page properties had been applied.  Once I deselected and re-selected, the new properties became effective and behavior was as expected.

Bottom line, I don't experience any of the misbehavior that Surrogate has encountered.  Guess I need to try out my Win10 PC.

It would be nice hear from others as to what they experience... My expectation is most will have same result as Surrogate has.  But it would be nice to build a misbehavior profile...impact of Win10 vs Win11, 32 bit vs 64,  what about different Visio verions including the subscription based releases.

You can use my file.  No editing necessary.  Just flip between pages and apply themes.  Either there are changes or not. 
Visio 2019 Pro

Visisthebest

Wapperdude I tried your file this does provide an anti-theme teflon coating on the shapes just one thing is missing: also put GUARD(0) in ColorSchemeIndex in the shape, then applying a shape is completely blocked on my Win10 Visio 2019 and 2021 PC's!
Visio 2021 Professional

wapperdude

OK.  Tried this on my desktop, still see proper behavior.  Without doing anmy editing, absolutely no Theme influence except where expected.

Computer:  Win10 Home, 64B.  Same Visio edition as laptop:  V2019 Pro.

Guess I'm just special!   ???  ::)   ;D
Visio 2019 Pro

Visisthebest

Wapperdude I have the same behavior, but only one difference compared to your PC: if I do not also put GUARD(0) in ColorSchemeIndex, then the color still changes when I switch themes, but the other styling is blocked just like on your PC.
Visio 2021 Professional