Visio Guy

Visio Discussions => ShapeSheet & Smart Shapes => Topic started by: novski on March 31, 2014, 12:26:55 PM

Title: smart connector text?
Post by: novski on March 31, 2014, 12:26:55 PM
hi
me again with some newbie questions...

I found quite a few posts that show different ways to make a connector have text on both ends. But i didn't manage to find one that does not brake when i ungroupe it and as well has text on both ends. All trough i managed to make the text be shown as shape data as i wold like it to be.
May someone help me to add the same shapedata as i have on one end to the other end?
I added a sample of my tests to the attachment. its actualy a copied sample of this tread: http://visguy.com/vgforum/index.php?topic=4689.0

best regards
novski
Title: Re: smart connector text?
Post by: Paul Herber on March 31, 2014, 12:31:47 PM
Shapes will almost always break when you ungroup them. Either open the group to edit it, or use the Drawing Explorer window.
Title: Re: smart connector text?
Post by: novski on April 01, 2014, 05:34:33 AM
Howcome there is a text hanging on one edge of the non-grouped cable in the attachment?
Is it not possible to add a second the same way?
Best regards
Novski
Title: Re: smart connector text?
Post by: Jumpy on April 01, 2014, 07:30:01 AM
Every shape (and so every connector) has one internal textbox. In your attachment that textbox is placed relative to the yellow control point and that's it. To have a second textbox at the other end you need a second shape (a shape that is only a textbox) and group it together with the connector. You have to change the group behaviour to 1D so it's a connector again.

Or you search the forum for examples of connectors with textboxes on both ends. That's something that is asked for regularly, so there are some threads about that here.
Title: Re: smart connector text?
Post by: novski on April 03, 2014, 07:34:48 AM
Hi again
i had some spare hours now and searched for a sample witch fits my needs. I found one wich makes all i needed. But now i got curius about how it works and can not figure out how that text sticks to the connector...

i followed http://www.visguy.com/2009/05/06/top-twelve-text-tips/ (http://www.visguy.com/2009/05/06/top-twelve-text-tips/) this agian but still i don't understand how the second  text is glued to the end of the connector... (the first is declared very well..)
is there any more sufficient posts around here somewere?

i found those in this first thread but that didn't help eather..
http://visguy.com/vgforum/index.php?topic=4689.0
http://visguy.com/vgforum/index.php?topic=1651.msg7116#msg7116

all throu this is very interessting...
http://www.visguy.com/2010/03/22/1d-shape-handles-through-the-years/

thanks for some more help..
Title: Re: smart connector text?
Post by: Yacine on April 03, 2014, 11:34:02 AM
Here are some explanations to the shape I posted in the link you mentioned (http://visguy.com/vgforum/index.php?topic=4689.0)
Hope that suffices,
Y.
Title: Re: smart connector text?
Post by: aledlund on April 03, 2014, 12:24:26 PM
yacine,
a very nice description and post.
al
Title: Re: smart connector text?
Post by: Jumpy on April 03, 2014, 01:40:48 PM
Another trick (learned from Graham Wideman's book some years ago) to
- place textboxes or
- special line-ends or
- determine the direction in which a connector connects to a shape

is to place a connection point very near the begin and end of the connector.

If you make them part oft the inner connector inside the group, you even can make them invisible.

Whenever the connector changes his pathes, Visio will recalc the placement of that connection points and will place them near the lineends again.

So you can use the coordinates of that connection points (together with the line ends) as a base for your calculations.
Title: Re: smart connector text?
Post by: Yacine on April 03, 2014, 04:22:17 PM
@Jumpy, I don't see the difference between the coordinates of the endpoints and those of connection points. you can calculate with both.
Title: Re: smart connector text?
Post by: Jumpy on April 04, 2014, 07:04:32 AM
You're right. The issue / trick with the connection points is, that they make it possible (together with BeginX/Y, EndX/Y) to calculate the direction your last line segment has. So you can determin if your connector connects to a shape from above, or from left or right and so it can help to place the textbox without overlapping other shapes.
Title: Re: smart connector text?
Post by: novski on April 08, 2014, 01:32:13 PM
I worked it out. Thanks for the Help.
my version in att...
cheers
novski
Title: Re: smart connector text?
Post by: novski on April 15, 2014, 03:35:49 PM
just stumled over a problem with my connector. As soon as i want a different line color it also colored the outlines of the textboxes.
Is it possible to prevent the texboxes to change linecolor in the group of my connector?
I wold need a red connector...

best regards
novski
Title: Re: smart connector text?
Post by: Yacine on April 15, 2014, 03:53:29 PM
Sure, select the textboxes and protect them against formating. (RMK/Format/Protection)
Or better, set in the shapesheet the Geometry.NoLine to "guard(true)"
This way you can format the text, but keep the border of the text boxes invisible.
Title: Re: smart connector text?
Post by: novski on April 17, 2014, 06:26:56 AM
Thanks for that hint. I had to work it out. first i just selected the Connector and tried to make the Geometry.NoLine to "guard(true)" but then the connector disapieard. After a second of brainstorm i understood what you ment and whent in to the Mastershape and selected the Text boxes it self. With Geometry.NoLine to "guard(true)" of the Text box now it works.
Thanks a lot
novski
Title: Re: smart connector text?
Post by: novski on April 30, 2014, 07:28:23 AM
Hi again
i sumbled over another problem with my connector.
As soon as i connect it in a direction thats oposite the flow from startpoint to endpoint it doesn't flip it with the connector.
There is a example attached. The two flow directions that end in normal OUT to IN points its all good but as soon as i make a connection that has IN and OUT on the same direction it shows the text on the wrong side...

How can i Flip the Text to handle the Cable direction and the Flowdirection automaticaly?
Title: Re: smart connector text?
Post by: Jumpy on April 30, 2014, 09:41:30 AM
Now it's interesting for you to know, in what direction your connector connects to a given shape.
I tried to explain one way to do this in post #8 above.
Title: Re: smart connector text?
Post by: Yacine on April 30, 2014, 01:07:02 PM
Did you use the control points?
The text boxes are attached to them, so you can move them to whereever you need them to be.
Title: Re: smart connector text?
Post by: novski on May 05, 2014, 07:47:26 AM
Hi again
Im back at my connector project again and cant follow both your advice about the connection point and this: http://www.visguy.com/2010/02/09/text-along-a-connectors-path-in-microsoft-visio-2010/ (http://www.visguy.com/2010/02/09/text-along-a-connectors-path-in-microsoft-visio-2010/) so i need some help...
can somebody explain me what i get back of this line:=ANGLEALONGPATH( Geometry1.Path, 1 ) and this: =POINTALONGPATH( Geometry1.Path, 1 )
? Used in a user defined cell.
Thanks
novski
Title: Re: smart connector text?
Post by: wapperdude on May 05, 2014, 06:08:07 PM
Here's a reference (It's V2013, but should be same for V2010:  http://msdn.microsoft.com/en-us/library/office/ff768508(v=office.15).aspx (http://msdn.microsoft.com/en-us/library/office/ff768508(v=office.15).aspx).  This lists the various functions available with a brief description of what each does.

There are more google entries if you search for each Visio funciton in question.

Wapperdude
Title: Re: smart connector text?
Post by: novski on May 05, 2014, 07:07:42 PM
yea. Thanks for the Link. My problem is that i have never programed jet. So im looking for samples all over the net but can't find simple ones that i cold follow.
Maybe i have to hire somebody for that.

I can define clearly what i want and what it should do:

I have several grouped shapes as stencils. They all have only one shape with shape-data. The connector is connected from a shape in the group to another group.
What i need is that the connector reads out the shape-data-field "Geraetename" of both sides and displays that name on the other end of the connector.

Does somebody have spare time?

best regards, novski