Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: abssorb on January 03, 2017, 08:06:12 PM

Title: One action with multiple SETF, possible?
Post by: abssorb on January 03, 2017, 08:06:12 PM
Hi,

I'm trying to make an action perform two things using a smartshape.  I'd prefer not to use a macro.
Searching on "multiple" is too broad, so I'm a little stuck

What I'm trying to do is have a shape labelled "Settings" where the user can choose a set of criteria.

This is a toggle.
Setting Prop.ShowSC changes the format of relevant shapes and highlights those that fit a criteria.
At the same time, an information box explains the highlighting, and appears / disappears with the highlights.

Both these work perfectly when set independently:
Actions_Row_2=SETF(GetRef(ThePage!Layers.Visible[7]),NOT(ThePage!Layers.Visible))
Actions_Row_2=SETF(GetRef(ThePage!Prop.ShowSC),NOT(ThePage!Prop.ShowSC))


But what I would like is the two things to happen with one toggle. Something like this:

Actions_Row_2=SETF(GetRef(ThePage!Layers.Visible[7]),NOT(ThePage!Layers.Visible)).....SETF(GetRef(ThePage!Prop.ShowSC),NOT(ThePage!Prop.ShowSC))


Where ..... is a syntax I'm unaware of.   Very grateful for your thoughts... :)



Title: Re: One action with multiple SETF, possible?
Post by: Surrogate on January 03, 2017, 10:23:46 PM
try syntax
SETF(GetRef(ThePage!Layers.Visible[7]),NOT(ThePage!Layers.Visible))+SETF(GetRef(ThePage!Prop.ShowSC),NOT(ThePage!Prop.ShowSC))
Title: Re: One action with multiple SETF, possible?
Post by: vojo on January 04, 2017, 01:50:53 PM
as formulas grow more complex, you can break them

user.formula1 = setf(getref(<blaha>),<blah1>))
user.formula2 = setf(getref(<blahb>),<blah2>

etc

actions.x = setf(getref(actions.x.checked),not(actions.x.checked)) + user.formula1 + user.formula2 + <etc>

helps with debug
Title: Re: One action with multiple SETF, possible?
Post by: abssorb on January 04, 2017, 06:33:20 PM
Many thanks Guys,

I already tried the "+" and the result is partial, it's good to know I'm on the right path.

The Prop.ShowSC toggles perfectly though both states, yet the layer hides but won't toggle back.
Title: Re: One action with multiple SETF, possible?
Post by: abssorb on January 04, 2017, 06:56:50 PM
Actually I found the problem

This works on its own:
Actions_Row_2=SETF(GetRef(ThePage!Layers.Visible[7]),NOT(ThePage!Layers.Visible))

But combined with the other via + I need to be specific with layer 7:

Actions_Row_2=SETF(GetRef(ThePage!Layers.Visible[7]),NOT(ThePage!Layers.Visible[7]))



So the final working line is:
=SETF(GetRef(ThePage!Prop.ShowSC),NOT(ThePage!Prop.ShowSC))+SETF(GetRef(ThePage!Layers.Visible[7]),NOT(ThePage!Layers.Visible[7]))

Thanks again :)
Title: Re: One action with multiple SETF, possible?
Post by: vojo on January 06, 2017, 02:00:40 PM
in general, having multiple action buttons affecting a common cell is tricky
usually, its better to have actions set their own check marks....then in the common cell, look at all checkmarks
and decide what to do