Author Topic: Dynamic Connector with Auto Numbering  (Read 3872 times)

0 Members and 1 Guest are viewing this topic.

AaronPOMT

  • Newbie
  • *
  • Posts: 7
Dynamic Connector with Auto Numbering
« on: September 04, 2017, 09:59:06 PM »
Hello,

I have downloaded and edited a dynamic connector created by John Goldsmith
http://visualsignals.typepad.co.uk/vislog/2015/04/building-a-labelled-dynamic-connector-in-visio.html

I use  this connector as labels in schematic drawings.

Could someone please help me with adding automatic numbering to this shape?

I have created different shapes for a Video label, Audio Label, Control Label and Data Label.

Each label will start as X001 (X = the type of label e.g. V for Video, A for Audio etc)

I am hoping to add automatic numbering where I am able to copy the shape and as it is copied, the label is numbered up.

Would it be best to use the Shape Sheet or code?

I have attached the stencil for reference.

Any help is greatly appreciated.

Thank you!


Hey Ken

  • Full Member
  • ***
  • Posts: 218
  • Just This Guy
    • The Pennsylvania Project, with Ken Krawchuk
Re: Dynamic Connector with Auto Numbering
« Reply #1 on: September 05, 2017, 07:45:17 AM »

Aaron:

    I put together an auto-numbering callout a couple of years ago, and it uses no code, only shapesheet functionality.  Assuming I understand your situation correctly (a big if), it should be pretty easy to use the same technique for your other shapes.  Check it out: http://visguy.com/vgforum/index.php?topic=6686.msg27867#msg27867.

    Good luck!

    - Ken


Ken V. Krawchuk
'caster

The Pennsylvania Project
Radio Podcast

10 to 11 AM Saturdays on WWDB 860 AM in Philadelphia
7 to 8 AM Mondays on KUR 1670 AM in Kutztown
On demand at http://PennsylvaniaProject.com

AaronPOMT

  • Newbie
  • *
  • Posts: 7
Re: Dynamic Connector with Auto Numbering
« Reply #2 on: September 05, 2017, 08:55:42 PM »
Hi Ken,

Thank you for replying.

Your shape looks like it does what I am needing, I just am unsure how to go about it.

My Dynamic Connector shape text is locked and can be edited via Shape Data. From what I know, this is needed so that both ends of the connector synch.

In my case, in the Sub Shape, "User.Text" is actually "User.Label"

This value references the Data in the Grouped Shape "Prop.LabelStart" please see attachment Grouped Shape Shapesheet

Could you please assist in clarifying exactly what I should put as the formula in the EventDrop cell?

Again, thank you for your help. I appreciate it.


JohnGoldsmith

  • Sr. Member
  • ****
  • Posts: 349
    • John Goldsmith's visLog
Re: Dynamic Connector with Auto Numbering
« Reply #3 on: September 07, 2017, 03:44:52 AM »
Hello Aaron,

Thanks for the comment on the blog post and apologies for the slow reply, but I'm just back from vacation.

Do I understand your requirement correctly?

You're looking to add some form of auto numbering to the connector and that this should integrate with the end labels?  For example, if the auto number in an instance was 8 then the beginning label would read something like 'X8' and the end label would read 'V8'.  Using this scheme you would want the letter prefix to be set via Shape Data?  Also, you don't want the number text appearing elsewhere (eg in the middle) in the connector?

Is this correct?

Scott Helmers has done a nice job of explaining the Number Shapes addon over here: https://www.experts-exchange.com/questions/29054687/Visio-Dynamic-Connector-with-auto-numbering.html?sharedLinkId=OkEHr2BhqTs%3D&cid=2035&cid=2035

When using the addon you'll notice that it adds three Shape Data rows and a text field to the target shape + a context menu item to the page.  I think my approach would be to add those three rows to the connector shape master so that you can then reference the auto number in the within the label ends.

Anyway, let me know if I've understood the problem correctly and we can go from there.

Best regards

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

AaronPOMT

  • Newbie
  • *
  • Posts: 7
Re: Dynamic Connector with Auto Numbering
« Reply #4 on: September 10, 2017, 06:36:08 PM »
Hello John,

Firstly, I would like to thank you again for creating the dynamic connector. It is fantastic!

Our requirement is for the connector to Automatically number when placed into a drawing, and for the start and end connectors to sync.

Our numbering system will have three numbers starting with 001 and going up incrementally from there.

The prefix before the three numbers will vary depending on the type of cable:

V for vision
A for Audio
D for data
C for control

I have created a stencil with 4 different dynamic connectors, one for each prefix.

We will only require the auto number to appear in the start and end label, we do not require text in the middle of the connector.

I will use the information provided by both yourself and Scott Helmers. If I have any issues, I will reply back.

Thank you

AaronPOMT

  • Newbie
  • *
  • Posts: 7
Re: Dynamic Connector with Auto Numbering
« Reply #5 on: September 11, 2017, 12:01:56 AM »
Hello John,

The auto-numbering works, but I am still unsure how to place the text field into the label.start so that the label still syncs and the label autonumbers.

I have attached screenshots.

Your help is very much appreciated

Thank you

JohnGoldsmith

  • Sr. Member
  • ****
  • Posts: 349
    • John Goldsmith's visLog
Re: Dynamic Connector with Auto Numbering
« Reply #6 on: September 12, 2017, 05:00:53 AM »
Hello Aaron,

Thanks for the screenshot, that's helpful.  So I think that the shape is already fairly close to what you want.  It currently has a Shape Data row (Prop.SyncLabels) that allows you to lock the end label text to be the same as the beginning one, so that means you only need to ensure that the beginning label says the right thing.

If you add the three Shape Data rows (Prop.HideShapeNumber, Prop.ShapeNumberText and Prop.ShapeNumber) that the addon inserts, then you'll be able to reference them from your Prop.LabelStart cell.

For example:

Prop.LabelStart = Prop.ShapeNumberText&Prop.ShapeNumber

If your Prop.ShapeNumberText value is 'V' then you should get the correct ('V1') in your start and end labels.  You could also modify the Prop.ShapeNumber.Format cell to give you the leading zeros as required.

Now the labels should read correctly you just need to hide the text in the connector, which I should work by setting the HideText cell to true in the group shape. 

I'm afraid I'm not able to test this as I'm having a crashing issues with my latest install, but let me know how you get on and I'll test it when I get Visio to behave itself.

Bear in mind that the addon is probably just looking for a known set of cells that it will insert if they don't exist, and the cells and formulas may vary depending on your confirguration of the addon's dialogs.

Hope that helps.

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

AaronPOMT

  • Newbie
  • *
  • Posts: 7
Re: Dynamic Connector with Auto Numbering
« Reply #7 on: September 12, 2017, 08:46:58 PM »
It works!

Thank you very much.

I changed the value of the Prop.LabelStart and changed HideText to True.

Very much appreciate your assistance

AaronPOMT

  • Newbie
  • *
  • Posts: 7
Re: Dynamic Connector with Auto Numbering
« Reply #8 on: September 12, 2017, 11:48:03 PM »
Hello John,

One bug I have noticed with the Visio Number Shapes add-on is that it only allows one set of auto-numbering per document.

I have created the dynamic connectors on separate layers so that I am able to have the correct prefix on the correct label.

Is there a way around me running the add-on 4 different times for the 4 different labels?

So far, I have been unable to run the add-on to the master shape, ideally, when the connector is dropped onto a drawing from the stencil, the auto-numbering will occur.

I have attached a visio drawing with the connectors.

So far, I have been running the add on to work on All Shapes but narrowed it down by layer.

Any help on this will be greatly appreciated

Thank you,



« Last Edit: September 12, 2017, 11:51:28 PM by AaronPOMT »

JohnGoldsmith

  • Sr. Member
  • ****
  • Posts: 349
    • John Goldsmith's visLog
Re: Dynamic Connector with Auto Numbering
« Reply #9 on: September 16, 2017, 02:33:53 PM »
Hello Aaron,

Yes, I see what you mean, page level numbering would be a useful option.

I guess it depends on what basis you want sequence allocation to occur - the addon offers some ordering strategies in the dialog (Advanced / Auto numbering sequence), but there are many other options that might be applied. 

Given that the addon, as it stands, has some short falls for your scenario I wonder whether a custom code solution might be more useful here?  Ken's solution uses ShapeSheet formulas and could be adapted to point at a page level cell, but I guess both this and the addon don't allow for any kind of reordering, which might be useful.

Maybe something that offers both an automated ordering strategy, based perhaps on drop order, backed up by list that could be manually adjusted (move up / down functionality) could be useful here?

So, some questions that might impact the choices here:

  • can you live with the document level numbering?
  • how should numbering be allocated for your scenario (position, drop order, connector length etc)
  • does numbering have to be completely sequential?  can there be gaps, perhaps a shape is deleted, or should the numbering self heal, or, do you care at all as long as each number is unique?
  • does numbering have to be 'live' or could it be something you 'run' at some stage (perhaps before saving the document)
Best regards

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

Decebal

  • Newbie
  • *
  • Posts: 9
Re: Dynamic Connector with Auto Numbering
« Reply #10 on: September 21, 2017, 11:10:11 PM »
Hello!

I've tried to use this connector in Visio 2007 and I found that end label has a fixed position with respect to begin label, no matter what begin point and end point are moved to.
I mean the start label moves with begin point correctly. But the end label doesn't move with the end point. The end label moves with begin point maintaining the X/Y offset from original drawing.

How is it possible to have this connector working correct in Visio 2007?