I'm back! LOL
Ok, after a few days of reading thru lots of great post on here, I found one this morning that really helped.
http://visguy.com/vgforum/index.php?topic=4689.15To give you a hint of where I was before finding and how happy I am to find this function let me explain.
Basically trying to get a connecting ray (Straight) that shoots away from the shape its connected to.
But couldn't figure how to detect which way to go away from shape.
I figured out that if I set the connector to Dynamic, Visio draws it away and I can use the first two X,Y points and determine N,S,E,W. Then could figure out where to place my EndX,EndY. then set back to Straight.
But due to certain timing and other logistics, was a big pain.
Well this morning I saw the post above that mentioned some undocumented functions.
_UCON_BEGTYP
This function, when give the BeginX,BeginY,EndX,EndY, and a couple other things for good measure returns 2,3,4,5 for the different directions.
So now I don't need to set to Dynamic and back to straight. I can now set my EndX,Y with one shots when the direction changes.
Here are the formulas I did for testing this morning.
I have created a Prop.BegConn =_UCON_BEGTYP(BeginX,BeginY,EndX,EndY,BegTrigger)+EndTrigger*0
This gives me 2,3,4,5 which I can then use to set the End Points.
I then have the following setting them!
Prop.North =IF(Prop.BegConn=5,SETF(GetRef(EndX),BeginX)+SETF(GetRef(EndY),BeginY+1),FALSE)
Prop.South =IF(Prop.BegConn=4,SETF(GetRef(EndX),BeginX)+SETF(GetRef(EndY),BeginY-1),FALSE)
Prop.East =IF(Prop.BegConn=3,SETF(GetRef(EndX),BeginX+1)+SETF(GetRef(EndY),BeginY),FALSE)
Prop.West =IF(Prop.BegConn=2,SETF(GetRef(EndX),BeginX-1)+SETF(GetRef(EndY),BeginY),FALSE)
Works great!!!!!
Love googling thru this forum. I have downloaded so many projects and favorited many of the discussions.
The SETF(GETREF was learned from one.
I am currently taking a Connection with labels and adapting to my needs!
So thanks to all for making this a vibrant community.
As soon as I wrap this up into my connector, Ill post.
My connector is basically a Labelled Connector with the connection line hidden as it crosses the drawing. Calling it an On-Sheet Connector. I am using a very nice one but it was a dynamic one to one. I want a one to many. So my idea is to have a From Connector which is the "one" and why I wanted just a short ray coming from the shape. Then I will have a To Connector which I will be able to attach several to the label for the From.