Animation (toggle show and hide of connections)

Started by darrenj1471, October 22, 2014, 03:23:03 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

darrenj1471

Hi guys

I wonder/hope someone can help, and if what Im after cant be done in visio, perhaps any help how I can.   I have to represent a pretty complex Content Architecture where content objects are authored in one system but published to many systems.

I have a good handle on what I want to produce but not sure on the how.  What Im wanting is a way to only show an objects connections when I select it ie to be able to toggle on or off the connections ideally via hover over but Im getting ahead of myself :) 

Can visio allow toggle on and off (ie hide and show) of connections between objects?  If not do you know any products (ideally freeware) that I can use to create what Im after?  Thanks

Paul Herber

Have a look at layers. Assign the connectors to a layer, then turn visibility of the layer on/off.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Yacine

When you say "represent" and "hover", do you mean that you need a fast way to toggle the visibility of the connectors? ie for a presentation?
Then you might consider the event "selection changed".
Yacine

vojo

also...show only the shapes connected to the shape you are hovering over?

I think that would take VBA

I do vaguely recall somebody did some work where the whole sheet is covered in semi transparent.  There was a circle in that that was
complete transparent.....you could move the circle around.   The idea was sort of like show a region of interest.
May not do what you want (connection to shape X that is on the far side the sheet would mean showing the whole drawing).

Some of the people posting here might remember it or have solutions in a similar vein

Might be able to build something yourself (no VBA)
   - 4 rectangles set to 50%
   - 5th rectangle set to 100% transparent and have control points on all 4 sides
   - Each of the 4 would use the appropriate 5th rect contol point to specify width or height
   - Group them all together
   - overlay on drawing of interest

As a result
   - if you move the 5th rectangle (green handles)...other 4 shapes autocalculate
   - if you resize the 5th rect (yellow diamond control points)....other 4 shapes autocalculate

wapperdude

Another approach would be to use the double click event.  Assign the connectors to a layer per Paul Herber.  Then, open the page shapesheet, set the double click event to toggle the layer visibility.
See attached as example:  http://visguy.com/vgforum/index.php?topic=5740.msg22885#msg22885


Per Vojo, the "masking" approach was done by VisioGuy, myself, and Yacine.  Each has slightly different features.  References are as follows:
   VisioGuy:  http://www.visguy.com/2008/11/28/super-mask-visio-clipping-shape/
    Wapperdude:  http://visguy.com/vgforum/index.php?topic=494.0
    Yacine:  http://visguy.com/vgforum/index.php?topic=5450.msg21608#msg21608

Wapperdude
Visio 2019 Pro

darrenj1471

wow swift replies, thanks Im just digesting them now.

Couple of quick notes:
Yacine, yes I plan to present the diagram and would like it to start with no connections showing and then when 'selecting' an object (be that by clicking it, right clicking it, choosing an option or the hover over was wishful thinking)

Vojo, no I dont want to hide the shapes themselves, they should be visible at all times but the connections themselves are the things I want to hide and show otherwise there will be lots of lines crossing over and be a very busy diagram
I will read your other notes (thanks) but I should say this now, Im clueless at VBA..:)

I will read the rest now and hopefully I'll be able to follow :)


darrenj1471

Ok that example given in http://visguy.com/vgforum/index.php?topic=5740.msg22885#msg22885 is exactly what I want to do

2 questions, how do I add/use layers and how do I assign a double click event to a shape?

This looks exactly what I was after


wapperdude

Before we go too far, lest I forget, double-clicking a shape to control its visibility, is somewhat problematical.  Hiding it not a big deal, but restoring it can be a problem, like, where is that shape???

That's the reason for the button, it's an independent shape.  The shape could be setup to toggle a specific layer or layers.  Thus you could use multiple buttons if so desired, each for a specific configuration.  Or, use the right click menu and select what to show, not show.

First, assign shape to layer:  just select shape, right click > format > layers.  Create a layer name, and assign the shape to it.  If layer already exists, just select desired layer (or layers).

To change a cell value in the shapesheet from some other cell, use the setf(getref(cellTochange),newValue).  Place the formula in the "controlling" cell. To toggle the value, instead of newValue, use NOT(oldValue), i.e., setf(getref(cellTochange),not(oldValue)).

Since layers belong to the page they're on, the formula looks like:  setf(getref(ThePage!Layers.Visible[1]),NOT(ThePage!Layers.Visible[1])).

To do multiple layers, use the "+" to catenate formulas, e.g., setf(layer[1] formula) + setf(layer[2] formula)


Alternatively, you can use the "actions" right click context menu and select the desired action.

If you open shapesheet of the button, you will see the Action section items.  Same thing as the double click only now, you can pick a specific layer(s) to show hide.  That involves the conditional "IF" formulas which establish the hide/don't hide conditions for each layer.

HTH
Wapperdude
Visio 2019 Pro

Yacine

#8
Hi Darren,
for your purpose Wapperdudes solution is certainly the best way to go.
Having to entertain an odience necessites to have control over your presentation.
So using a double-click or a selection is better than a hover action, where you might move your mouse inadvertantly and cause disctraction.

Nevertheless, your initial request challenged me to try to get a hover reaction in visio.
I enclose an "essay" of a drawing doing just this. Namely showing connectors connected to a shape over which you hover.
It includes parts of all suggestions made by Paul, Vojo and Wapperdude.
At this late time, I am unfortunately too lazy to try to explain it. May be we can get through the steps on a later time.
Have a try and get an impression of the possibilities of the solution.

The macro is triggered by the "Save" event. So save the document, then move the mouse over the shapes to see it working.
Maybe it can be of use for someone.

Cheers,
Yacine
Yacine

wapperdude

@Yacine...

That's just spooky!   :o

Pretty cool!   8)

Wapperdude
Visio 2019 Pro

Yacine

Yacine

darrenj1471

Just about to try the layers instructions but wanted to pick up on the point below.  Perhaps I wasnt clear but I think I said I want to toggle the connections ie the lines.  The shapes should always show.  Ie lets say I have 4 shapes, 2 have a connection to each other and the other 2 have connection to each other.  I dont want both connections showing.  I want to be able to choose which connections to show ie click one object and make its connection show, and like wise on next shape.  Is that clear?  cheers

"Before we go too far, lest I forget, double-clicking a shape to control its visibility, is somewhat problematical.  Hiding it not a big deal, but restoring it can be a problem, like, where is that shape???"

darrenj1471

Err, I mentioned I was a relative newbie right? :)  I fail at first hurdle as you said right click>format>add layer but when I select format I only see Text, Line, Fill and Add Theme?

wapperdude

@ "Newbie":  not a problem.

The layers thing isn't going to work for what you want.  You will need to run a macro to search for connectors for the shape in question.  Can still use a double click event to trigger the macro.  Should be able to toggle the connectors between show/hide.  Yacine's last effort is a good place to start, with some modifications.  He will probably have an answer before I do. 

The changes would be:
  1.) Replace hover with double click.
  2.) This should avoid the "save" event to trigger.
  3.) Use geometry.noline or geometry.noshow to show/hide the connectors.

Wapperdude
Visio 2019 Pro

wapperdude

Attached has a modified version of file I had.  Double click will toggle the connectors.  Need to add the double click "call" to each shape.

Wapperdude
Visio 2019 Pro