Visio Guy

Solution-specific Visio Discussions => Flowcharting => Topic started by: Lynx11 on March 03, 2017, 02:18:21 AM

Title: Arrow head on connector corners
Post by: Lynx11 on March 03, 2017, 02:18:21 AM
I do a lot of flow diagrams for work. Some people like (demand...) to have arrow heads at every corner on connectors. Is there a clever way to do this that is more efficient than adding separate arrow heads or using multiple connnectors? I use Visio 2010.
Thanks in advance for tips on this.
Title: Re: Arrow head on connector corners
Post by: wapperdude on March 03, 2017, 04:45:59 AM
That's about as clever as it gets.

Wapperdude
Title: Re: Arrow head on connector corners
Post by: Surrogate on March 03, 2017, 04:47:52 AM
The best article about Visio's Line Ends (https://translate.google.ru/translate?sl=ru&tl=en&js=y&prev=_t&hl=ru&ie=UTF-8&u=http%3A%2F%2Fwww.prodigitall.narod.ru%2Farticles%2Farticle20.html&edit-text=&act=url)
Title: Re: Arrow head on connector corners
Post by: Yacine on March 06, 2017, 07:02:41 PM
Hi Lynx,
Your request is indeed one that I heard already from several people, but it did not bother me until now that I got some spare time to think about the problem.

My answer to the problem until now, was to use a line pattern with repeating arrow heads. Downside of this method: the arrows are distributed evenly over the length of the connector and you need to add some rounding to get avoid gaps or overlapping strikes. (Top connector in my drawing)

So far for the on board tools.

Luckily Visio is a quite powerful tool, which can be tweaked.
I needed indeed many concepts to get this smartshape to what I uploaded.
1)    Make the the arrowheads sub-shapes of the connector.
Therefor draw a simple connector, then transform it into a group. Open the group and insert as many arrow heads as you need. (I inserted 12)
2)    Make sure to set the arrow heads to
•    no line
•    protect them against formatting
•    give them absolute sizes (not dependent on the parent's size)
3)    Now for the placement of the arrow heads. Requirements:
•    Place on the corners
•    Orient according to previous vertex
•    Hide if not needed.

So far quite easy - write by means of SET/GETREF the right formulas in the sub shapes and done (Check the scratch section of the connector for almost all the smart formulas). But wait...

The problem here, is that connectors have a dynamic geometry section with rows being added and deleted as the user formats it. This means that addressing cells becomes a problem (geometry1.x3 may not exist). Once a cell in the geometry section gets deleted all the formulas referring to it get deleted as well. So how to preserve formulas regardless if the cells they refer to exist or not? "SETF/GETREF". This shapesheet function allows to write formulas literaly to another cell – eg. "geometry1.x3". If the cell does not exist, the function does nothing.

Next problem: if the cell reference does not exist anymore, the formula is replaced by the value of the formula at the time it became invalid. So you cannot check right away if the referenced cell exists or not. The trick: use setf/getref to first empty the cell, then write the formula. This way, if the reference does not exist the cell remains empty.
Recapitulating the whole process: write all the formulas referring the geometry section of the connector as literals, but address the sub-shapes directly. This way duplicating the connector will update the sub-shape IDs.

I know that my explaining capabilities are quite limited, but I do hope that I did not confuse you too much. I can try to give more explanations on request.
So what's last to say? It is difficult to write so much formulas without errors. Best would be to write a routine to set up both the connector and the sub-shapes automatically ... a nice exercise for Lynx.
Title: Re: Arrow head on connector corners
Post by: wapperdude on March 06, 2017, 08:43:08 PM
@Yacine:  Phew!  That's a lot of formulas.  Wow!

Your description of the task reminded me of something that John Goldsmith did here:  http://visualsignals.typepad.co.uk/vislog/2015/04/building-a-labelled-dynamic-connector-in-visio.html (http://visualsignals.typepad.co.uk/vislog/2015/04/building-a-labelled-dynamic-connector-in-visio.html).  He leveraged the RectSect fcn to determine directionality.  Wonder if that might simplify the calculations?

Anyway, played with it.  Very cool.  Minor bug when a corner is eliminated, but corrects itself when the connector is "jiggled".  A refresh issue.  Nice job!

Wapperdude