### Author Topic: Dynamic Connectors smal blue handles  (Read 15247 times)

0 Members and 1 Guest are viewing this topic.

#### Jumpy

• Hero Member
• Posts: 1061
##### Re: Dynamic Connectors smal blue handles
« Reply #15 on: September 11, 2014, 01:51:56 AM »
=DEPENDSON( TxtPinX, TxtPinY )

Is described in Visio Guys/David Parkers post. Rather down in the comments section.

#### novski

• Full Member
• Posts: 182
##### Re: Dynamic Connectors smal blue handles
« Reply #16 on: September 17, 2014, 12:16:27 AM »
Hi
I tryed this formula but it seams to be false in some way. Im not able to find the faulty part so maybe someone may look over it?

Code
``=DEPENDSON(TxtPinX,TxtPinY) + ABS(NOT(ISERR(INT((INDEX(0,”Geometry1.x1″)))))) + ABS(NOT(ISERR(INT((INDEX(0,”Geometry1.x2″)))))) + ABS(NOT(ISERR(INT((INDEX(0,”Geometry1.x3″)))))) + ABS(NOT(ISERR(INT((INDEX(0,”Geometry1.x4″)))))) + ABS(NOT(ISERR(INT((INDEX(0,”Geometry1.x5″))))))``

I can't follow the double "(" in front of the INDEX function. But the failure appears without as well..

Does somebody see the failure?

#### wapperdude

• Global Moderator
• Hero Member
• Posts: 3828
• Ideas Visio-lized into solutions
##### Re: Dynamic Connectors smal blue handles
« Reply #17 on: September 17, 2014, 12:37:54 AM »
Too many parenthesis, (and seems like quotes are optional)...

Code
``=DEPENDSON(TxtPinX,TxtPinY)+ABS(NOT(ISERR(INT(INDEX(0,Geometry1.X1)))))+ABS(NOT(ISERR(INT(INDEX(0,Geometry1.X2)))))+ABS(NOT(ISERR(INT(INDEX(0,Geometry1.X3)))))+ABS(NOT(ISERR(INT(INDEX(0,Geometry1.X4)))))+ABS(NOT(ISERR(INT(INDEX(0,Geometry1.X5)))))``

but, if quotes necessary, this also is error free:
Code
``=DEPENDSON(TxtPinX,TxtPinY)+ABS(NOT(ISERR(INT(INDEX(0,"Geometry1.X1")))))+ABS(NOT(ISERR(INT(INDEX(0,"Geometry1.X2")))))+ABS(NOT(ISERR(INT(INDEX(0,"Geometry1.X3")))))+ABS(NOT(ISERR(INT(INDEX(0,"Geometry1.X4")))))+ABS(NOT(ISERR(INT(INDEX(0,"Geometry1.X5")))))``

Does seem like both give the same results....to quote or not to quote.

Wapperdude
« Last Edit: September 17, 2014, 12:48:55 AM by wapperdude »
Visio 2019 Pro

#### novski

• Full Member
• Posts: 182
##### Re: Dynamic Connectors smal blue handles
« Reply #18 on: September 17, 2014, 06:50:15 AM »
Thank you Wapperdude!
Now i was able to follow what Jumpy wrote :
Quote
So even VisioGuys suggestion to use Dependson may not work. But maybe it would work to set the formula new every time:

User.SetFormula
=Dependson(...)+SETF(GetRef(User.RowCount),"=ABS(...)+ABS(...)+ABS(...)+...")
But it seams to me that that doesn't work ether because the "geometry.Xnr" always gets reset asoon as the line decrements sections. it gets set to REF() or if its alone in a user.xy cell it seams to take the value of PinX-PinY or something similar...
Is it possible to protect that cell from visio?

#### wapperdude

• Global Moderator
• Hero Member
• Posts: 3828
• Ideas Visio-lized into solutions
##### Re: Dynamic Connectors smal blue handles
« Reply #19 on: September 17, 2014, 11:31:39 AM »
Directly protect the cell...No.  The behind the scenes code will always clobber it.  The best you can do is "after the fact" re-write the formula.

If this is a real problem, then you may want to abandon using the dynamic connector and use instead an ordinary line.  It can still have the gluing, and it allows you to route as desired.  But, if you make changes, it will not automatically update, ... but the automatic updating is the problem in the first place.  But at least you could enter formulas that won't get clobbered.

Wapperdude
Visio 2019 Pro

#### Jumpy

• Hero Member
• Posts: 1061
##### Re: Dynamic Connectors smal blue handles
« Reply #20 on: September 18, 2014, 04:55:54 PM »
Had to try a bit at first, but got it to work somehow. See attachment.

Wasn't possible to fit it into one big formula, because it uses a trick with SETF: If SETF can't set the formula, the old formula doesn't get overridden. That wouldn't be possible with only on cell and one big formula because that formula would never be written new.

If you reduce legs of connector you got Ref-Error. That won't be overwritten (see above) but is savely captured with IsErr function. If you increase number of legs again, SEFT can reset the orignial formula for a geometry section and all is fine again.

« Last Edit: September 18, 2014, 05:03:56 PM by Jumpy »

#### novski

• Full Member
• Posts: 182
##### Re: Dynamic Connectors smal blue handles
« Reply #21 on: September 19, 2014, 06:20:48 AM »
wow.

thats a real solution that works. WONDERFULL!!!
Thank you verry, verry much!

I just can not follow how it does the job...

Can you explane me what the cell Prompt does ant how the Ref() gets set back to the Geometry.x8 in User.Row7?
I have never worked with the Cell Prompt until now...
Best regards
Novski

#### Jumpy

• Hero Member
• Posts: 1061
##### Re: Dynamic Connectors smal blue handles
« Reply #22 on: September 19, 2014, 06:32:05 AM »
Cell Prompt is just a cell in the user defined section, where you can for example strore comments about what your user definded cell does. But it is a cell like "every other cell" so I use it for my SETF+Dependson function to repair the formula in the user defined cell, if possible.
Instead of using the prompt cell I could have added another user defined cell wor each row to contain the SETF+Dependson-Function.

Possible above means: It can only repair the cell that counts leg number 6 if the connector has 6 or more legs. Otherwise it does nothing and the REF() formula remains until the connector gets more legs again.

And less I forget. You can expand the example for more then 8 legs, if you think it neccesary.

#### novski

• Full Member
• Posts: 182
##### Re: Dynamic Connectors smal blue handles
« Reply #23 on: September 19, 2014, 08:54:44 AM »
i did! i now use 12 legs.
-realy cool to use a text section to prevent Visio changeing it.

may i ask a new question:

so what i get out of that is a text: Geometry1.X8 -if i have 8 legs.
and i wold like to use the value out of that geometry section"Geometry1.X8".

How can i get hold of that value inside Geometry1.X8

I need it to set the Text direction on my line depending on that value...

Thanks a lot for that help...

#### Jumpy

• Hero Member
• Posts: 1061
##### Re: Dynamic Connectors smal blue handles
« Reply #24 on: September 19, 2014, 09:47:11 AM »
I need it to set the Text direction on my line depending on that value...

First:
For that you need the 2! last entries in the geoemetry section!

Second:
User.SetLineEnd could simply be:
="Geometry1.X" & User.LineCount

Problem may be that User.LineCount is sth. like 8.000 so you'd need to round/floor or otherwise cut of the decimals.
Or use your long formula as it is.

I don't have an idea. Would have to play arround a bit with that. Probaly needs an SETF approach, too.

--------

Beside that. An completly other way to accomplish your goal ist to place a connection point a thousands of a milimeter beside the End of your connector. Visio will automatically place that connection point near the end of the connector whenever you move it. So the connection point will always be on the last leg of the connector (if the leg doesn't get smaller than a thousands of a milimeter ). If you calculate X/Y position of the connection point into page coordinates (there are shapesheet functions for that) you can compare them to EndX/Y values of the connector to "guess" the orientation of the last leg.

#### novski

• Full Member
• Posts: 182
##### Re: Dynamic Connectors smal blue handles
« Reply #25 on: September 20, 2014, 12:41:24 AM »
Hi Jumpy
What preferences wold you give to that connection point? (IN,OUT,IN/OUT)
best regards, novski

#### novski

• Full Member
• Posts: 182
##### Re: Dynamic Connectors smal blue handles
« Reply #26 on: September 20, 2014, 11:58:00 AM »
Im trying since hours without a clue how to get that string to give out the Value behind its Variable.

I created a String in User.SetLineEnd="Geometry1.X8"
Geometry1.X8 is a Variable from that i nead the Value.

Does anybody know how to get hold of that value?
« Last Edit: September 20, 2014, 01:51:50 PM by novski »

#### Yacine

• Hero Member
• Posts: 2708
##### Re: Dynamic Connectors smal blue handles
« Reply #27 on: September 20, 2014, 02:29:25 PM »
Record a macro, open the shapesheet of the shape, modify geometry.x8 and read the result in the macro.
Yacine

#### novski

• Full Member
• Posts: 182
##### Re: Dynamic Connectors smal blue handles
« Reply #28 on: September 20, 2014, 03:58:13 PM »
Thanks for the reply, I think that will not do the job.

maybe a bit more short and straight forward:

I want to resolve a string to a variable that exists in the ShapeSheet of my Visio file.

best regards
novski

#### Yacine

• Hero Member
• Posts: 2708
##### Re: Dynamic Connectors smal blue handles
« Reply #29 on: September 21, 2014, 01:31:19 AM »