ParentShape! Help please. (Visio 2007)

P

Paul Herber

The SETATREF Function (http://msdn2.microsoft.com/en-us/library/ms425563.aspx)

Uses ParentShape!PinX in it's second example. but I just get error in
formula if I try and use it as in the example or on its own.

when I search for ParentShape! it seems like everyone wants this but that it
doesn't exist!

Does it? if so any idea why it won't work

The <ParentShape> is just a placeholder for the name of an actual
shape. So, no, it doesn't exist, use your own shape's name here
instead.
..
 
J

John Goldsmith

Hello Bob,

The example uses two shapes that it calls (for want of better terms) Parent
and Child. You could actually name your shapes as such but more likely is
that they'll have real ID values

In this case you're entering a formula into the Child shape, whose really ID
might be something like Sheet.2, so that it tracks the position of the
Parent shape (possibly Sheet.1). Right click on your first shape that you
want to track and select Format / Special... Make a note of its ID
property, which is at the top. The example calls this shape the parent
shape, So if your ID is 1 say, then your shape reference that you place in
the child shape PinX cell should be "Sheet.1!PinX".

A further point is that the example formula references a two User cells.
These needs to be in place before you add the PinX/Y formulae otherwise
you'll get an error as you're trying to reference a cell that isn't there.

Best regards

John


John Goldsmith
www.visualSignals.co.uk
 
L

Lucky Bob

Thanks that is what I assumed even through it was not shown with <> but I was
hoping as I have lots of shapes and the parents may change often.
 
L

Lucky Bob

Thanks for trying to help John,

You quickly sumerised what it took a few hours for me to learn earlier
today. I'll try and summerise what I am trying to achieve in case anyone has
any sugestions.

We maintain diagrams of the racks in our server rooms, these diagrams are
looked at and updated during projects to show physical layouts or planned
physical layouts. Many of the shapes(Servers/routers etc) contain shape data
for the heat and power consumption etc (and all can have it). We also have an
excel spreadsheet with the same equipment and the same data the only thing
extra is the spreadsheet totals this data by rack and by data centre.

If we move a system or do what ifs we need to amend two documents. I hoped
to remove/automate the spread sheet based on the diagrams. I.E. put a system
in a rack it could pick up the rack number from the parent. that way I could
run a simple report getting all the data I need.

any ideas?

Thanks in advance
Bob
 
J

John Goldsmith

Glad you're clear on that now!

Well, the standard method of associating a server with a rack would be to
use glue (I assume you're already using a Rack Diagram or equivilant) and I
see that you've been discussing this with JuneTheSecond. You could
certainly read the diagram programatically and add a User cell containing
the shapes (server's) parent rack and this could be 'reported'. The glue
would ensure the servers moved with the rack and keep everything together.
You could carry out a similar process with the rack to room relationship.

In terms of the double files problem, the link with Excel isn't a bad one,
and certainly if you're using 2007 Pro this becomes a much more simple task,
again in terms of associating a server record with a rack shape. Other data
links such as the Database Wizard (also in 2003) would allow a two-way link
(read/write) between data and shapes.

So in summary, my suggestion would be glue you server shapes and then
read/process them programatically and ideally have on drop events that carry
out the server/rack association at that point.

The above feels a little generic so let me know if you'd like more details
on specific areas.

Best regards

John


John Goldsmith
www.visualSignals.co.uk
 
L

Lucky Bob

Thanks again John,

My VB is really rusty as my current job doesn't use it often (I haven't done
any since VB6!) . Is this the basic process:

A drop event I will call a VBA Function
Using the dropped "object" as a start find the parent.
Get the value from the parent objects property.
Then set a property on the dropped on the dropped object.

Regards
Bob
 
J

John Goldsmith

Hello Bob,

Yes, basically that's it although I'll modify my advice and suggest you
listen for a cell change event on say the BeginX cell and then check the
connections ToSheet to return its respective 'glued to' shape and as you
say, add this shape name to a User cell in the master that you could call
something like User.Rack.

You might find this link useful for the event listening part:
http://msdn2.microsoft.com/en-us/library/aa201790(office.10).aspx

There's also a good deal of stuff within the SDK although this is mostly
VB/C#.NET. VBA would be fine for this.

A couple of other points are the CALLTHIS ShapeSheet function that allows
you to call methods in your code and the SpatialNeighbors property of the
shape object (http://msdn2.microsoft.com/en-us/library/ms367943.aspx), which
you might find useful in order to get the rack to room relationship even if
its not glued.

Anyway, I hope that sets you on the right path. No doubt you'll have other
specific questions as you go so maybe post these as separate questions so
the rest of the group benefits.

Best regards

John


John Goldsmith
www.visualSignals.co.uk
 

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