Data Graphic to display calculated result based on other shape fie

D

David Perry

Have a scenario where I need to calculate the remaining power within a rack
by subtracting power each time a shape is inserted into the rack.

Have a custom stencil which contains three shapes.

1. Rack - One data field is "Watts Remaining"
2. Power Strip - Three data fields - "Amps", "Volts" and "Watts" (Watts
already calculated based on entries in the amps and volts fields)
3. Server - Has a "Watts" field

What I need to do is associate a data graphic with the rack which lists the
value in the "Watts Remaining" field. The watts remaining needs to = the
total watts available within the rack by adding all
shape.powerstrip.x.prop.watts.value fields together and subtracting the sum
of all shape.server.x.prop.watts.value fields.

How is this done?

The problem I have is referring to the shapes in the calculation since the
shape names are different each time you drop one on the canvas. Might be
server.9 one time and next it will be server.243.

Thanks in advance.
 
A

AlEdlund

David Parker has some interesting code on how to associate shapes, and then
applying data graphics in his book "Visualizing Information with MS Office
v2007". I'd suggest you start with that.

al
 
D

David Perry

Al,

I'm not having a problem creating a data graphic. That task is pretty well
covered. I think the more appropriate question here is how to reference the
value in a user defined field of a shape before you've added the shape to the
sheet. The formula's I've come across all reference absolutes and until the
shape is dropped, there is no ID to reference.

Thanks
 
D

David J Parker

I think that you need to have extra properties on your rack shape to store
the totals, then have some code to update these properties by iterating
thru the connected or contained servers, etc.
You can then have your data graphics attached to your rack.
My book contains example code such as updating the U position of equipment
in a rack, and examples of adding up values from properties in connected
shapes.
 

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