Toggle valve shape color

S

scott beall

i have a piping valve shape and want to assign red and green to represent
'off' and 'on'. i want to be able to toggle the valve shape color by
double-clicking on the shape. this is used as an interactive tool during
operability discussions of a piping system.

i know how to generaly use Visio, but am not familar with any of the
programing techniques. i'm really not intent on learning program, but want
to be able to easily build a schematic and have it do simple techniques like
toggle colors. i do have the process engineering stencils.
 
A

Al Edlund

do you have visio 2003 pro with the mechanical engineering stencils? Just
curious about whether the valves stencils might be appropriate?
al
 
V

VKY

What you should do is:

a) Click on your shape (valve) and then set a default color (either red
or green, doesn't matter.
b) Then click on the menu Window | Show ShapeSheet while your valve
shape is still being selected.
c) On the shapesheet window, find the section "Events" and locate the
cell "EventDblClick".
d) The cell should show No Formula, so you need to paste in this
formula: IF(FillForegnd=2,SETF("FillForegnd",9),SETF("FillForegnd",2))
e) Close the shapesheet window and double click on your valve to test.

Hopes it helps
 
S

scott beall

Yes, I have 2003 PRO. The valve shape I am using is in the Process
Engineering Stencil group. Reply from VKY worked!
 
B

Bob Vardell

So, to take that one step further, if we wanted to have the user right click
to select "complete" or "incomplete" and that would change the color, is that
just as easy?
 
J

John Goldsmith

Hello Bob,

Take a look at this link on creating shortcut menus:

http://msdn2.microsoft.com/en-us/library/aa200979(office.10).aspx

There's an example in there that demostrates how to hide or show the arms of
a chair shape. The visibility of the arms is controled by the respective
shape geometry cell "NoShow" looking at the state of a User cell (State).
So in your situation you just need to check the User.State cell from the
respective Fill cell instead. For example:

FillForegnd = IF(User.State=0,2,3)

Will set the foreground colour to red if User.State = 0 or Green for any
other situation.

Hope that helps.

Best regards

John


John Goldsmith
www.visualSignals.co.uk
 
D

David Parker

And, if you don't want the FillForegnd to be accidently updated use:
FillForegnd = GUARD(IF(User.State=0,2,3))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top