Line Connector Horizontal or Vertical Only Not Diagonal or Curved [Solved]

Started by jmw_visio, February 06, 2016, 11:54:14 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

jmw_visio

Hi
Trying to create a connector that only goes vertical or horizontal.
I have played around setting EndX and EndY Based on a variable I have set up that is N,S,E,W

I would like to set this Direction based on the Begin Glue to an Object.

But I don't know where to begin to find that kind of info so I can redirect.

Any ideas or another approach?

Thanks

JuneTheSecond

Try to search in web.
There are many articles how to make yore own connectors or shapes.
For example https://support.office.com/en-us/article/Create-a-custom-connector-48f47591-b9d5-4e6f-9203-5b34ce09a5e9
Basically connectors are not much different from shape.
Best Regards,

Junichi Yoda
http://june.minibird.jp/

Yacine

@Junichi, Why did you not recommend your latest 1D shape with fixed angle?

@jmw, I wonder how this connector is supposed to work.
What should happen, when the shapes are horizontally so far apart that their horizontal projections do no intersect?
Guess you'd better stick with Junichi's advice and use a line, instead of a connector.
Search the forum for his posts.
Yacine

JuneTheSecond

Ah! Now I understand your request to connector.
Your request is far higher than that of beginner.
The connector has to work like a kind of machine element.
Horizontal connector has to fix relative y-coordinate of connected two shapes.
I wonder if it is realized only by a special horizontal connecter.
If it is possible kinematic machinery simulation may be realized with Visio.
It may be a very big challenge for Visio.
Best Regards,

Junichi Yoda
http://june.minibird.jp/

jmw_visio

Thanks for the replies!

Actually I guess I should describe a little bit more.

Basically the most important part of this connector is to attach the 1st side to an object. The other side will not connect to a shape so I want it to move in relation to the connection shape and go away from it.

The other end of the connector will have a small circle with label in it.

I will then use another connector based on the Dynamic Connector and connect it to the circle/label and the other side to a shape.

I have used the great labelled connection I saw in a few articles. But then thought I would like to create a one to many connector. After reviewing varying issues I decided it would be easier to make a connector for one side "the one" and then just connect multiple connectors to it "the many"

So to sum it up, when I connect this to a shape I basically want to move it away from the shape. If I connect to the left side I want it to go left. If I connect to the top, I go up. If I connect to the bottom, I go down, and if I connect to the right, I go right.


jmw_visio

Until I figure out how to insert images, here is a Visio 2013 drawing with my shape at this point.
With comments to help describe objective.

Thanks

jmw_visio

Also, how do I insert images into a message? I see the insert image which gives me http img tags.
If I have some screen captures saved what do I put in the image tag?

If I can give some screen captures of the shapes and shapesheet equations it might be easier to follow.
Thanks

jmw_visio

Yes Yacine, actually I did create this with a line.

This whole connector thing gets me confused.

To create the shape
I created new master, added a line, grouped it, then added the label inside the group.
Added the lines Geometry to the group shape, made the group 1-D, then deleted the line.

Which I will have a question about after I get thru this hurdle, LOL.
Basically the art of getting multiple objects on a shape but not have it show up as a big group block when dropped. Like it to just show the connection and its points. I guess that is 1-D? If I try and take the Dynamic Connector and add a shape to it, I lose that. The labelled connector I found uses the Dynamic Connector with extra shapes but when dropped it still looks like a regular Dynamic Connector.

jmw_visio

Just got thru looking at your INCREDIBLE Isometric Shapes Yunichi!

So much to digest! Unbelievable great stuff!

I noticed your 'Continous Number' Stencil.

Basically that is what I was trying to create. Except yours points to the connection point where mine points away at the label. So basically that is the shape I want except I would love for it to automatically flow away 180 away from the connection point relation to the connected shape.

Currently I have shape data fixed list of N;S;E;W and I select which direction to go. But would love to automate this based on the connection location.

jmw_visio

Ok, After testing some today, I discovered turning ObjType to a 2 is my friend. This turns on routing, etc. and so when I connect the X Endpoint to a shape, it routes the connector away from the object. I then can tell what direction I need to go by looking at the first 2 Geometry point X1,Y1 and X2,Y2. Now to get the connector to bounce to that direction and a specified length, I just need to adjust the EndXX,Y cells.

Now to figure out best way to monitor the X,Y changes and react and set EndX,Y

Looking at possibly using the EventXFMod and calling a subroutine to do the code above.

Firing a sub from it successfully and Debug.Print the name. Now to determine how to filter certain events so that I am not firing at every moment since EventXFMod is firing 5 or more times every time I move the X Endpoint.

jmw_visio

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.15

To 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.



jmw_visio

Yes Yacine,
That's basically where I started!

Added an option for a circle label, and an arrow on the from connection side.

Then I started thinking of how to attack the one-to-many issue.

That connector is a work of art, beautiful and very inspiring!

Thanks for posting the link, I forget how many things I have looked at.

I will be using that connector as the major basis for the "many" To Connectors.

His connector is a dynamic connector and he hides the middle section of the connector with a different Geometry Section. Very clever!

jmw_visio

Here is a first pass on the master element

Basically 2 modes Normal where the label shoots away from the connected shape and horizontal where N and S connectors turn horizontal
Various User Settings are Different Shapes for the Label and ability to change connector lengths

jmw_visio

Ok Here is a Second Pass

2 Masters Now
On 'Sht Conn To' and 'On Sht Conn From'

Basically The "To" is the One of the One to Many and the "From" is the Many of the One to Many.

The dwg has one "To" on the left side and three "From" on the right side.
The bottom has the same except I turned on the connectors so you can see how they are connected.

One Note I found another method to determine connection path at the beg and ends.
ANGLEALONGPATH(Geometry.#.Path, 0) is the Beg Point
ANGLEALONGPATH(Geometry.#.Path, 1) is the End Point

I am using this in the From Master to determine how to move my Geometry Section 2 (The lone label and connection points)

I have a connlength for the From arrow so you can specifiy the From Arrow Line. The dynamic connector often choses something a lot shorter like 0.2 inches. You can see that on the dwg when I turned on the whole connector line. Would love to make it go to this connlength also, but with it being the end of the geometry sections, its hard to set them. Any ideas would love to hear them.

Next going to program the ability to sync the Label ID, etc from the To Master to the From Masters.
And add some more text desc fields for display if more info needed.