same shape - different data

Started by ed.hickey, August 25, 2014, 01:01:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ed.hickey

Although I have been using Visio for years, I have not explored its dynamic capabilities.  I am looking to show different data in the same shape depending on the context.

For example, our infrastructure is divided into environment classes such as UAT and QA.  For each environment class, the diagram (server layout and connections) is exactly the same, only the data in the shape is different for each actual environment.  UAT-1 has the identical layout to UAT-2 but the hostname and IP (data in the shape - box) are different.  I am tired of making a change to a diagram and then having to cascade those changes to all the other diagrams in that class. 

I have been able to find information on dynamic data, but not quite what I am looking for - either that or I am just not understanding.

I am using Visio 2010.

Any help appreciated.


Yacine

#2
Hi Ed,
I would even say that the dynamic features are the only reason to use visio at all.  ;)

From what I understood, it is just text in the shapes that need to change.
Ideally, you would write the text values in different custom properties of the shapes. Then, depending on the drawing target, you would switch the displayed text.

This could be done either

       
  • by a macro, that iterates through all the shapes of the drawing,
  • or by setting up the switch in the shapesheets of the document (or page) and the shapes.
The latter being a very unflexible, but effective solution.

The text property is modified by:

    Dim vsoCharacters As Visio.Characters
    Set vsoCharacters = shp.Characters
    vsoCharacters.Delete
    vsoCharacters.AddCustomFieldU YOURFORMULAHERE, visFmtNumGenNoUnits


The shapesheet switch is demonstrated in the enclosed snapshots.

HTH,
Y
Yacine