Turn Layers on and off

Started by red, November 18, 2008, 10:07:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

red

I'm using Visio 2003. I'm working through the Sept 5, 2006 Visio Guy post the "The Hidden World of Shapes". I set up a shape on my main layer that allows me to right click and toggle the value of a user variable (User.Color) between 0 and 1. In one implementation, I use the following in the NoShow area of other shapes to toggle the shape on/off

=IF(Callout 1!User.Color=0,1,0)

This works great to toggle the individual shape on/off.

Now, I wanted to do the same thing, but to turn an entire layer on/off.

I thought I followed the example, but when I enter the formula above in the Visible cell of the Layers on the Page Shape Sheet, I get a formula error message. It is the exact same formula that I successfully use at the shape level since I copy and paste. I tried adding a Pages[Page-1]! reference but got the same error and also referring to is as ThePage!User.Color with the same result.

My guess is that there is something special I need to do to reference a shape user cell from the page shape sheet, but I'm at a loss at what to try next. The shape I'm selecting is not on the layer I'm turning on/off.

Any thoughts?


Visio Guy

Hi Red,

Check out the "Layers" section in this article: The Hidden World of Visio Shapes
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010

red

I thought I was following the article, however upon rereading it appears that Layers are another example of things that need to use SETF, rather than allowing me to put a formula in the Layers.Visible cell that references a value n another cell. I've now run across this twice, and it is not very clear to me what the criteria are for when I can use a formula in a cell and when I have to use SETF. Any good references for this?

At any rate, I've now made it work for a single layer using the method in the article, but what I really need to do is simultanously toggle two layers by turning one layer off and another on at the same time. How do I structure the action formula to accomplish two things? Is there a way to execute two of the SETF formulas in the action with some sort of delimiter or something?

michelleh

Just put a "+" in between the function calls:  SETF(...) + SETF(...)

red

Great, that works.

So the only mystery left is why I can't reference a cell value from another shape in the pages shape sheet, as opposed to using SETF from the shape to set the value in the page cell. I have no problems within the page shape sheet referencing cells within the page shape sheet. For example, I use SETF to fix the value of visible in the layers, and then write a formula to make the print value match the visible value.

What I'm doing works, I'm just not sure I understand why it doesn't work with direct cell references.

Visio Guy

Here's a related example that works without using SETF.

See what happens when you flick the switch!
For articles, tips and free content, see the Visio Guy Website at http://www.visguy.com
Get my Visio Book! Using Microsoft Visio 2010