How to change shape properties in dynamic groups?

Started by Zarty, July 30, 2010, 11:15:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Zarty

If I have a visio diagram with objects connected to represent, for example, complex access paths between Applications and databases and between databses and other databases (a kind of network), I want to build in some interactive features so that if a Block (representing an application) is selected, all the databases required by that application plus any connectors between them are highlighted. 

For example on the Diagram, if someone viewing it clicks on ApplicationA then all the objects including ApplicationA, DB2, DB3 an DB4 and connectors are filled with a certain colour and/or the line style changed.   Alternatively, if the Block representing ApplicationB is clicked, DB4, DB5 and DB6 would be highlighted as another group... In otherwords, in this simple example, DB4 is both ApplicationA and ApplicationB's groups. 

I was wondering if there can be some action on the Application blocks or Database shapes such that when they are clicked, a record of the related objects can have their properties changed?  Could the Visio database facility be used perhaps?

The reason I want to do this is that the entire diagram of interconnected Applications and Databases is a complex plate of spagetti so being able to highlight specific groups of objects with predermined relationships will be very helpful.    How can I best do this?   Also, assuming it can be done, is there a way that offers the easiest way to keep the underlying information/groupings up-to-date?  Eg. DB10 get's added to ApplicationA's list of required databases.

Clive

Jumpy

You could give all Shapes a user defined cell, for example User.Highlighted. In all format related cells, for example LineColor, you write a formular like =If(User.Highlighted,RGB(255,0,0),RGB(0,0,255)).
Thats the part you have to do in the ShapeSheet of all Shapes.

In the Shapes that can start the Highlighting frenzy you have to use the DoubleClick Event to start VBA Code, at best with CALLTHIS("Code_Name").

The code has to iterate through all shapes and set all User.Highlight cells to False.
Than set the cell of the starting shape to True.
Than look witch connectors are connected to that shape and highlight them.
Than look at the shapes connected to those connectors and highlight them.

This needs a bit of code, but there are examples out there to check pathes of shapes along connectors, that will be a good start.
It will propably a good idea to make parts of the code "rekursiv" (Don't now engl. expression).

Perhaps someone has an idea that works without VBA, but I fear not.

Jumpy

Paul Herber

Electronic and Electrical engineering, business and software stencils for Visio -

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