It seems to me these key functions ("LocToLoc", "LocToPar" and Just Plain "PAR") are not well documented. I imagine there is tremendous power lurking somewhere in the following seemingly meaningless and or redundant Descriptions and examples from MSDN (Thanks Guys!). I have not been able to find anything more helpful than this so here we go.
==================From MSDN ==================
LOCTOLOC Function [Visio 2003 SDK Documentation]
Returns a transformed point in local coordinates in the destination coordinate system.
LOCTOLOC(srcPoint, srcRef, dstRef)
srcPoint A point in local coordinates in the source coordinate system.
srcRef A reference to a cell in the source object.
dstRef A reference to a cell in the destination object.
Remarks
The LOCTOLOC function converts a point from local coordinates in a source shape to local coordinates in a destination shape. You can use this function to construct a shape, for example, in terms of a point from another coordinate space. You can also use this function to transform a local point to page coordinates, or vice versa.
This function works even when the source and destination shapes are within groups. It also adjusts for rotation and flips in the intermediate transformation.
The source and destination coordinates must be on the same page.
Example
LOCTOLOC(PNT(LocPinX, LocPinY), Width, ThePage!PageWidth)
Converts the local pin of the shape associated with the formula to a point on the page.
LOCTOPAR Function [Visio 2003 SDK Documentation]
Returns a transformed point in parent coordinates in the destination coordinate system.
==============================
LOCTOPAR(srcPoint, srcRef, dstRef)
srcPoint A point in local coordinates in the source coordinate system.
srcRef A reference to a cell in the source object.
dstRef A reference to a cell in the destination object.
Remarks
Converts a point from local coordinates in a source shape to parent coordinates in a destination shape. You can use the LOCTOPAR function to set parent coordinates in cells, such as PinX, PinY, BeginX, and BeginY in a shape using another point from another coordinate system.
This function works even when the source and destination shapes are within groups. It also adjusts for rotation and flips in the intermediate transformation.
The source and destination coordinates must be on the same page.
If the destination is a page, which has no parent, the result is expressed in the page's local coordinates.
Example
LOCTOPAR(PNT(LocPinX, LocPinY), Width, Sheet.4!Width)
Converts the local pin of the shape associated with the formula to parent coordinates of Sheet.4.
=======================================
Lastly for Just Plain "PAR" here is at least a decent explaination of "PNT" the understanding of which is a prerequisit for what follows.
PAR Function [Visio 2003 SDK Documentation]
Returns the x,y coordinates of a point in the coordinate system of the shape's parent.
PAR(point)
Remarks
In Microsoft Office Visio, a point is a single value that embodies a pair of x- and y-coordinates. If the shape is in a group, its parent is the group. If the shape is not in a group, its parent is the page.
Example
PAR(PNT(PinX,PinY))
In this expression, PNT converts a pair of coordinates in the current shape into a point. PAR then converts the point into a pair of coordinates in relation to the lower-left corner of the page or group that contains the current shape.
Before I continue, I will share somthing which I discovered about the long forgotten "Scratch" section. References made in the ScratchX and Y seem to be shown in Parent Coordinate Reference. Anyway in what follows I will be using "Scratch" sections. I suspect that what follows would work if the formulas used are entered in say a Geometry Section, but I find the additional translation difficult to follow (Pea Brained).
If you are interested in following along. Please open a new visio drawing page. To this page add a single circle THEN add a single rectangle. Open that circles ShapeSheet, within the ShapeSheet add a Geometry Section (we will use it for something). Then add a Scratch Section.
Into the Geometry 2 section (Geometry2.X1) moveto cell X insert =Geometry1.X1
Into the Geometry 2 section (Geometry2.Y1) moveto cell Y insert =Geometry1.Y1
This starts the Line that will be drawin by Geometry 2 from the center of the Circle (it is ok if you choose to draw an ellipse, but I don't want to type ellipse over and overagain so just forget HS Geometry for a minute).
Now we turn our attention to the Scratch and the subject at hand.
Let me for a moment laud one other thing about Scratch, when you add rows they add from the top (I LOVE That, not sure why but I do).
Let's use the examples lifted from MSDN and see what happens.
In Scratch Row 1 insert Example 1, by inserting exactly this forumula into both Scratch.X1 and Scratch.Y1 you will see that the values are different.
LOCTOLOC(PNT(LocPinX, LocPinY), Width, ThePage!PageWidth)
Are you supprised to see the PinX and PinY respectively? I wish I really understood the use of width and the page width, but I am learning as we go here.
Now let's try the second example (inserting a row into scratch and once again; In Scratch Row 1 insert Example 2, by inserting the forumula as shown below into both Scratch.X1 and Scratch.Y1 you will see that the values are different (please note that I have changed the reference to "SHEET.2" instead of "Sheet.4" as above.
LOCTOPAR(PNT(LocPinX, LocPinY), Width, SHEET.2!Width)
Now even I am supprised to see PinX and Pin Y respectively. Can this be really useful?
Ok so let's try the last example
PAR(PNT(PinX,PinY))
WOW! what is that???
Set the Lineto in Geometry 2 as follows.
Geometry2.X2=Scratch.X3-Scratch.X1
Geometry2.Y2=Scratch.Y3-Scratch.Y1
The Line should go from the center of your circle to the lower left corner of the page. So what good is that since you already know the pinx, piny, locpinx and locpiny so you could have calculated easily.
Let's now try somthing with LocToPar
Insert formulas
Scratch.X1=LOCTOPAR(PNT(LocPinX,LocPinY),Sheet.2!Width,Width)
Scratch.Y1=LOCTOPAR(PNT(LocPinX,LocPinY),Sheet.2!Width,Width)
Geometry2.X2=Scratch.X1-Scratch.X3
Geometry2.Y2=Scratch.Y1-Scratch.Y3
Ok now that looks promising, see how the line now connects the center of the circle to the lower left corner of the rectange (note that this is Sheet.2).
Also note that I switched the second and third parameters, I wish I understood what these are supposd to mean.
srcRef A reference to a cell in the source object = Sheet.2!Width
dstRef A reference to a cell in the destination object = Width
Of course if you add the Sheet.2!LocPinX and Sheet.2!LocPinX to the Geometry2.X2 and Geometry2.Y2 respectively the line will connect the centers of the two shapes.
I wish I had untied this knot, I fear I have only put a bow on top of a granny. I am hoping to learn from Ya'll.
Best regards
Steve