Author Topic: Line labels at BOTH ENDS of the line?  (Read 15807 times)

0 Members and 1 Guest are viewing this topic.

tinsley207

  • Newbie
  • *
  • Posts: 9
Line labels at BOTH ENDS of the line?
« on: September 22, 2015, 01:34:19 PM »
Is this possible?  Can I have a line with two places for text labels?  One at the beginning of the line and one at the end?  I need this because I'm making an engineering drawing with lots of lines representing wires.  Each wire has a number.  It would be nice to have a label in the drawing at EACH END of the wire.  I know you can select the line an just start typing but the text defaults to the middle of the line and it looks like you only get one shot at the text.  Any ideas?

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4840
  • Ideas Visio-lized into solutions
Re: Line labels at BOTH ENDS of the line?
« Reply #1 on: September 22, 2015, 01:51:11 PM »
Visio 2019 Pro

JohnGoldsmith

  • Sr. Member
  • ****
  • Posts: 358
    • John Goldsmith's visLog
Re: Line labels at BOTH ENDS of the line?
« Reply #2 on: September 25, 2015, 03:34:39 AM »
Hi,

I'll add a link to this post I wrote recently:

http://visualsignals.typepad.co.uk/vislog/2015/04/building-a-labelled-dynamic-connector-in-visio.html

The main focus started with hiding the standard line in the Dynamic connector, but then progressed to include end labels.

Hope that helps.

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

Yacine

  • Hero Member
  • *****
  • Posts: 3210
Re: Line labels at BOTH ENDS of the line?
« Reply #3 on: September 25, 2015, 04:33:45 AM »
That's a very nice one. Thank you, John.
Yacine

tinsley207

  • Newbie
  • *
  • Posts: 9
Re: Line labels at BOTH ENDS of the line?
« Reply #4 on: September 25, 2015, 02:11:22 PM »
Thanks very much!  I will start with that stencil and make it my own!  PERFECT!

Nate

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4840
  • Ideas Visio-lized into solutions
Re: Line labels at BOTH ENDS of the line?
« Reply #5 on: September 25, 2015, 05:02:41 PM »
It looks nice, John.  Looked thru what you did, lot of thought and effort.  Unfortunately, for those of us who have NOT moved beyond V2007, we can't take advantage of your development.

Turns out, handling the text box at the begin point is relatively easy because only the 2nd line in Geometry 1 needs to be checked.  But, to get the proper placement at the end point, you need the last segment, and that could be anywhere depending upon number of corners.  Easy enough to find with a little code, but, alas,  no pure shapesheet solution for us sluggards.

The RECTSECT was a nice touch!

Wapperdude
Visio 2019 Pro

JohnGoldsmith

  • Sr. Member
  • ****
  • Posts: 358
    • John Goldsmith's visLog
Re: Line labels at BOTH ENDS of the line?
« Reply #6 on: September 28, 2015, 10:31:29 AM »
@tinsley - great.  Glad that's worked for you.

@yacine and @wapperdude - thanks guys, it was fun to do and sorry it doesn't port back to 2007 - I wanted to put those PATH... functions to work :)

I did start off by looking at the 2nd line of the first geometry section, but unfortunately when you choose a curved line style the row type gets changed to NURBSTo and the referencing formulas get blown away.

Another interesting aspect is that line jumps get included in SEGMENTCOUNT, contary to what the docs say, so this makes it difficult to assume that each segment represents a corner in the connector.

Best regards

John
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/

vojo

  • Hero Member
  • *****
  • Posts: 1710
Re: Line labels at BOTH ENDS of the line?
« Reply #7 on: September 29, 2015, 01:36:28 PM »
so got to ask:  Why wouldnt you do this as a group
- standard or preferred connector with all the behaviors you want
- first text block = beginx + 5mm, beginy+ 5mm   (maybe some logic like gravity to help...maaybe some guard()  )
- send text block = endx -5mm, endy -5mm (maybe some logic like gravity to help maybe some guard()
- Group them
- Set children first in behavior

you can drag connector where you want...text boxes follow

I do this for pure horizontal lines (transaction sequences)....general purpose is more complex.

So just asking in case I ever want to make it more general purpose (horizontal/angled/vertical/etc)

wapperdude

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4840
  • Ideas Visio-lized into solutions
Re: Line labels at BOTH ENDS of the line?
« Reply #8 on: September 29, 2015, 05:01:10 PM »
Nice to have the site back!  Been waiting to post this for a couple of days.

First, thanks again, John, for your effort.  I guess imitation is high complement.  I  used many of your features to develop this V2007 version.

Here's a connector shape with a "textbox" at each end.  Behavior mimics the shape that John Goldsmith did above, except this is V2007 compatible.  Because some of the function's that John leveraged only became available with V2010, it was necessary to use a small macro to get the placement of the textbox at the connector end point.  The necessity is due to the option to hide the line segment spanning between the two textboxes.  There are a couple of additional features which I've added.  Everything is available via right click menu, double clicking the shape, or using the normal GUI interface.  While the textboxes make most sense for right angle connectors, the shape doesn't "blow up" for either straight or curved.  See attached.  The macro just "orients" the end textbox such that the control point is the line termination point, and, is always closest to the connection point side of the shape.

@Vojo:  there is no obvious choice.  Either method ultimately uses about the same amount of development to get all of the formulas and relations defined.  I think of the "connector" as being the parent.  So, I always expect it to be on top.  Making the connector a group, guarantees this, plus, it saves one extra shape level.  Personal preference.  Ultimately, what works best for you and whomever else may use the shape.  Each approach has merits and short-comings.

Wapperdude


« Last Edit: September 29, 2015, 08:03:13 PM by wapperdude »
Visio 2019 Pro

JohnGoldsmith

  • Sr. Member
  • ****
  • Posts: 358
    • John Goldsmith's visLog
Re: Line labels at BOTH ENDS of the line?
« Reply #9 on: October 01, 2015, 08:31:01 AM »
@Vojo - my connector does use grouping.  The labels are sub-shapes just as you suggest.  The extra geometry section in the top connector shape is just there to provide short lines to the labels when the main (first) geometry section is set to NoLine.

@wapperdude - That's a nice job and I particularlly like the multi-leg connectors too!
John Goldsmith - Visio MVP
http://visualsignals.typepad.co.uk/