News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Arrow head on connector corners

Started by Lynx11, March 03, 2017, 02:18:21 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Lynx11

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.

wapperdude

That's about as clever as it gets.

Wapperdude
Visio 2019 Pro

Surrogate


Yacine

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

wapperdude

#4
@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.  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
Visio 2019 Pro

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 224 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1114KB.
Tokens: post-login.
Cache hits: 14: 0.00187s for 26,733 bytes (show)
Cache misses: 3: (show)
Queries used: 16.

[Show Queries]