Author Topic: Protect custom stencil shapes from themes  (Read 418 times)

0 Members and 1 Guest are viewing this topic.

Blackhawk

  • Jr. Member
  • **
  • Posts: 14
Re: Protect custom stencil shapes from themes
« Reply #30 on: July 11, 2019, 12:59:15 PM »
Thanks.   This I have done, but I also want to set the Theme Properties to 0 and was not able to find where in the object model this is located.

Do you know how to find this?

Croc

  • Full Member
  • ***
  • Posts: 179
    • Visioport
Re: Protect custom stencil shapes from themes
« Reply #31 on: July 11, 2019, 01:22:58 PM »
Code: [Select]
    For i = 0 To 7
        ActivePage.Shapes(1).CellsSRC(visSectionObject, visRowThemeProperties, i).FormulaU = "0"
    Next
Instead of ActivePage.Shapes (1) you need to substitute the desired shape

Blackhawk

  • Jr. Member
  • **
  • Posts: 14
Re: Protect custom stencil shapes from themes
« Reply #32 on: July 12, 2019, 08:12:31 AM »
Ah!  Thanks.

I didn't see CellsSRC in the object model when looking at the watch window.    I will try that.

Thanks

Surrogate

  • Hero Member
  • *****
  • Posts: 895
    • ShapeSheet™ Knowledge Base
Re: Protect custom stencil shapes from themes
« Reply #33 on: July 12, 2019, 09:22:17 AM »
Please looking for "Sections, Rows, Cells" at right side

PS You can't find these items in Watch Window
« Last Edit: July 12, 2019, 09:31:43 AM by Surrogate »

Blackhawk

  • Jr. Member
  • **
  • Posts: 14
Re: Protect custom stencil shapes from themes
« Reply #34 on: July 17, 2019, 11:18:05 AM »
Just want to say thanks to everyone for your assistance.   

I ended up having to abandon the effort once again.  No matter what I do I still keep running into issues where Visio tries to change things despite protection settings, shapesheet guard formulas, etc., and it is taking WAY WAY too much time to debug and write code to make it work properly.   Such a shame...

The solution at the moment is to disable themes in the document and then everything works.   That is too bad because I would like other shapes to be themed in the same document but just leaving my stencil shapes alone.   

Once again, thanks for helping.   I learned some interesting things about Visio (quite frankly, however,...shouldn't need to know for this type of problem) that perhaps I can apply at some point down the road for other things.

Keep up the great work with the forum!

vojo

  • Hero Member
  • *****
  • Posts: 1243
Re: Protect custom stencil shapes from themes
« Reply #35 on: July 17, 2019, 01:24:14 PM »
one last suggestion:  Have tried guarding the theme cells themselves?

Blackhawk

  • Jr. Member
  • **
  • Posts: 14
Re: Protect custom stencil shapes from themes
« Reply #36 on: July 17, 2019, 01:34:14 PM »
To some extent yes, but the problem is, I have a lot of different types of shapes and it takes a bit of time to discern what is all required.

For example, some shapes are just simple lines.   So the only way to protect those, seemed to be protecting the Format option, but then that affects the ability to change the arrows when in the document (which I need that ability).

Other times, the shapes are composites which some shapes need protecting in one way, and other shapes need it differently.   It became quite a daunting task to test all the possibilities of what to protect and what not to.   It wasn't like I had hoped which was just loop through all the shapes and subshapes setting all the theme properties to 0.   Sometimes they had formulas in them. 

I have learned that Visio is pretty damned powerful, but also frickin complicated if it doesn't behave like you want it to.   It would be nice if the "Theme Protection" settings just worked, but there seems to be so many other factors that get in the way.

Maybe when I am bored and have nothing better to do with my life, I will go back in and figure this out.  Right now, I gotta get stuff done.   :o