unfortunately, setting -Angle does not work very well when trying to automate solutions. You need to know how many groups your object is in and then use -Angle for each.
For example, I have shapes 1 & 2 in 3, but then 3 could be in a 4, and 4 might even be in a 5
To fix the problem, I am using the AngletoPar command
ANGLETOPAR(0 deg.,ThePage!Width,Width)
unfortunately, this function doesn't seem to work correctly when FlipX is true on a parrent. to account for this, I am using:
=IF((parrent)!FlipX=0,(ANGLETOPAR(0 deg.,ThePage!Width,Width)),(ANGLETOPAR(180 deg.,ThePage!Width,Width)))
Users will have to manually rotate if parrents beyond the first are flipped in the X. I am forced to use visio 2002, and am currious if this is fixed in future versions.
I also changed the formulas used to calculate the offset from the control point for PinX and PinY and removed the sin and cos. I am using a a combination of LOCTOLOC and LOCTOPAR so that I conver my control point to the Page coordinate system, add my offset, and then convert back into the shape's parrent's coordinate system.
=GUARD(LOCTOPAR(PNT(PNTX(LOCTOLOC(PNT((parent)!Controls.X5,(parent)!Controls.Y5),(parent)!Width,ThePage!Width)),PNTY(LOCTOLOC(PNT((parent)!Controls.X5,(parent)!Controls.Y5),(parent)!Width,ThePage!Width))-0.25),ThePage!Width,Width))