Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: soultrane on July 10, 2009, 05:50:36 PM

Title: Drawing a power tree
Post by: soultrane on July 10, 2009, 05:50:36 PM
The fundamental question:

    Is there a way to "draw" a heiarchy so that the parent node can add values at the child nodes?

[Parent Node:  Property Sum = 15]------+-----[Child Node 1: Property Value_To_Sum = 10]
                                                       +-----[Child Node 2: Property Value_To_Sum = 3]
                                                       +-----[Child Node 2: Property Value_To_Sum = 2]

    The task is to automate this, so if I added a new child node with the "Value_To_Sum" property populated with some value (say 4), then the parent node would automatically add this to its sum when I drew a line from the parent to the child?

     I would prefer to automate this using built-in functions, smart shapes, etc. instead of visual basic or some coding method. 

     Previously, I had used a spreadsheet to do this task.  However, if visio can do this - I would like to use this more visual method.

Title: Re: Drawing a power tree
Post by: wapperdude on July 12, 2009, 04:59:28 PM
I don't think you can do this without code.  But, for starters, take a look at this post:  Calculate available watts remaining in rack based on shapes within the rack  (  The text that Al refers to is:  Visualizing Information with Microsoft Office Visio 2007.

You may also want to check out these topics on VisioGuy's blog site:
Path Analysis in Visio (
Analyze Connectivity Between Process Flows (

Title: Re: Drawing a power tree
Post by: aledlund on July 12, 2009, 06:21:12 PM
The problem I ran into is that of hierarchys of greater than two (i.e. calculate a racks power, when the subcomponents (blades in servers and network switches) are the real culprits. Chassis vendors (servers/networking) often have custom proprietary tools to help in this area. So you had to provide a mechanism that could drill down, in my case I use the hierarchyid structure in ss2008.

When recommending commerical grade solutions for rack power management I usually recommend stuff from the APC product sets.

The current version of Netzoom ( has some enhanced reporting that does not require active probes, but once again this is a code based solution and not free.

Title: Re: Drawing a power tree
Post by: vojo on July 12, 2009, 10:11:34 PM
This just another case for shape awareness in visio :D

If a shape had a unique handle that could be used as a look up from another shape and funneled into getref(), then
this problem would be trivial. 

Even if the handle was funneled thru a special connector so shape 1 could figure out and
use the handle on the other end of the connector (shape 2)....something like a general purpose begtrigger and endtrigger macro that was standard and useful other than routing ;D

If visio had this...there are lots lots lots of cool things that could be done
Title: Re: Drawing a power tree
Post by: Visio Guy on July 13, 2009, 03:47:43 AM
Don't the Pivot Diagrams in Visio 2007 (Professional only??) do this sort of thing?

I haven't played with them for a while, so I don't clearly remember the details, but I'm pretty sure they are all about "rolling up" sub-totals and sub-items.
Title: Re: Drawing a power tree
Post by: aledlund on July 13, 2009, 05:31:41 AM
That's exactly what pivot tables are for, drill down and compute. The relatively simple challange is to understand the hierarchy chain (parent/child) and recurse through it. I do it external to the drawing because of the performance hit of going across the +com boundary. The other (primary) reason is that by putting the data external I can get out of the report writing business for users that want something 'a little different'.
Title: Re: Drawing a power tree
Post by: wapperdude on July 13, 2009, 09:03:08 AM
Yes.  Pivot feature not included in V2007 Std.
Title: Re: Drawing a power tree
Post by: vojo on July 13, 2009, 11:15:28 AM
but getting into pivot diagrams to do this is like taking a sledge hammer to a peanut.
One ends up having to build a whole convoluted solution (several files, etc) do this simple task.
If one goes that far....mind as well think about writing code as well (at least for dispersing the solution out to users)
Title: Re: Drawing a power tree
Post by: soultrane on July 15, 2009, 01:22:08 PM
I am happy to see the discussion over this.  I had read a certain amount of information on the forum but had not been able to cover all discussions.  Although this clarification is not altogether useful, this is not intended as a rack calculator.  This is for power within a "complex" electronic device with several power rails and cascaded power rails (such as used in a desktop computer system).  Therefore, using different shapes is not as useful (i.e. different shapes representing different current values) as they are dynamic.  As I get a spec update, I want to update the child current requirement and have that propogate up the line (depending on efficiency of the regulator/etc and calculating required input regulator current).

This is simple to do with excel.

Is there a function that can limit a calculation based on "geography"?  I can make a rule that the child nodes are all located within an (X1,Y1)<-->(X2,Y2) boundary. 

So can I say SUM(ALL_WITHIN(x1,y1,x2,y2,CURRENT_VARIABLE))?

This is still not optimal since it is only "easy" to use this method with one node per level (the problem with using above of how to know that child nodes are connected to the given parent node, or some other parent node).  However, it may help solve the problem without using code if such a thing exists.

It sounds like the intuitive function that is required to make this sort of summing to work may not exist in Visio (Vojo's comment).  And, although there MAY be a way to do this without code - it's a bear.

For reference, I do not see any "professional" designation to my installation of Visio.  The "about" box says:

Visio 2007 (12.0.6336.5001) SP1 MSO (12.0.6320.5000)

Even so, I'll do some research on pivot tables and determine if it makes sense to use them/update Visio/etc.

Later comment: I used the method described here ( ( to determine I do have the professional version (display data on shapes is available).

Thanks again.
Title: Re: Drawing a power tree
Post by: soultrane on July 15, 2009, 04:27:48 PM
As a followup - if no solution can be found to setup an environment within Visio to enable automatic summing (and other calculations) of shapes connected in a tree layout, then I will consider the more restrictive use of importing data from excel:

Then I can draw the tree and hope that connections will not drastically change.  Update the excel spreadsheet and use its formulas to keep track of the data.  Then link this spreadsheet to a graphical representation of the data in visio.  Seems a bit cumbersome to release two files (xls and vsd) in order to manipulate this visio drawing.  However, it may be the easiest way compromise and get almost what I'm after.
Title: Re: Drawing a power tree
Post by: STHBRDG on September 29, 2011, 11:16:46 AM
I know that this is old, however...

I watched video from Microsoft wherein, a developer used Windows Forms and C# to embed a visio document control.  That approach would give you the full power of Visio in addition to the controls available in Windows Forms including what you are talking about.