Dynamic Connectors smal blue handles

Started by novski, August 30, 2014, 11:22:45 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jumpy

=DEPENDSON( TxtPinX, TxtPinY )

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

novski

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?

=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

#17
Too many parenthesis, (and seems like quotes are optional)...

=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:
=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
Visio 2019 Pro

novski

Thank you Wapperdude!
Now i was able to follow what Jumpy wrote :
QuoteSo 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

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

#20
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.


novski

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

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

i did! i now use 12 legs.  8)
-realy cool to use a text section to prevent Visio changeing it.

may i ask a new question:
i made a User.SetLineEnd= =IF(User.LineCount=1,"Geometry1.X1",IF(User.LineCount=2,"Geometry1.X2",IF(User.LineCount=3,"Geometry1.X3",IF(User.LineCount=4,"Geometry1.X4",IF(User.LineCount=5,"Geometry1.X5",IF(User.LineCount=6,"Geometry1.X6",IF(User.LineCount=7,"Geometry1.X7",IF(User.LineCount=8,"Geometry1.X8",IF(User.LineCount=9,"Geometry1.X9",IF(User.LineCount=10,"Geometry1.X10",IF(User.LineCount=11,"Geometry1.X11",IF(User.LineCount=12,"Geometry1.X12",FALSE))))))))))))

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

Quote from: novski on September 19, 2014, 01:54:44 PM
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.

As for your true question:
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

Hi Jumpy
What preferences wold you give to that connection point? (IN,OUT,IN/OUT)
best regards, novski

novski

#26
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?

Yacine

Record a macro, open the shapesheet of the shape, modify geometry.x8 and read the result in the macro.
Yacine

novski

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

Sorry, I misunderstood your message.
Maybe this topic is closer to your problem: http://visguy.com/vgforum/index.php?topic=3870.0
Yacine