A couple of notes to get you going:
1. It's best to group shapes inside of a master, since Visio will group
them anyway when you drop them. You save the performance hit by
2. The location of Connections.N.X/Y is *local* to the shape that
contains the connection point. If you want to reference the location
from a separate shape, you need to transform that location to the parent
of the shape. In your case, both shapes should probably have the same
parent (the group), so something like this:
PinX = PAR(PNT(Sheet.5!Connections.A.X, Sheet.5!Connections.A.Y)) + Width/2
PinY = PAR(PNT(Sheet.5!Connections.A.X, Sheet.5!Connections.A.Y)) + Height/2
Notice that the PAR(PNT(... stuff is the same for both formulas. That is
because a PNT holds x and y data, and PinX and PinY know how to grab
just the part that they want. If it doesn't work quit right, you can
explicitly specify which part of the PNT to grab like this:
PinX = PNTX(PAR(PNT(Sheet.5!Connections.A.X, Sheet.5!Connections.A.Y)))
PinY = PNTY(PAR(PNT(Sheet.5!Connections.A.X, Sheet.5!Connections.A.Y)))
I know it looks a bit complicated and cryptic, but maybe this will get
you a bit further along.
Hope this helps,
Visio Guy: Smart Graphics for Visual People
Post by Chelmite
I'm trying to build some "smart" shapes that will scale properly when the
shape is stretched.
I've drawn one object (Shape.5), an outline of a square.
It has four connection points.
Each connection point is specified with a formula such as the following to
calculate the midpoint.
Another object is some text that's supposed to be aligned with a connection
So far, this is dandy. These two objects are inside a Master Shape on a
When I make an instance of the shape, I can scale as I'd like.
However, the pieces of the cell can be selected and modified.
If, inside the Master shape, I create a group with the square and the text,
as soon as I group the two objects, the text moves down close to the origin
of the page instead of staying linked to the connection point of the square
inside the group.
What's the correct formula for tying an object to a point on another object.
Thanks for your help
I'm using Visio 2003 on Windows XP, SP3.