MoveTo.X increases when End.X gets closer

Started by novski, September 26, 2014, 07:44:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

novski

Hi
Once more I have another question.  ;D
I don't understand why the Cell Geometry1.X1 (MoveTo.X) increases to a max of 2.5mm as soon EndX comes closer than 2.5mm towards the 0mm point of Geometry1.X1 from the positive side and the same at negative side in reverse.

Can somebody explain me why that happens?

Thanks
novski

wapperdude

Here's the unsatisfying answer... I think you've discovered a bug in the dynamic connector algorithm.  I was able to duplicate the behavior on my pc, starting from a fresh drawing, i.e., I did not copy your file.

But, if you try the same thing with an ordinary line shape, everything behaves properly as expected.

Moral of the story:  don't do this with dynamic connectors.   :o

Wapperdude
Visio 2019 Pro

Jumpy

Maybe it has sth. do to with the routing settings and the minimal distance between shapes?

novski

I tried to change all the distances between shapes or connectors. Without a result. No changes at all.
I then tried to change BeginX and EndX with
=GUARD(POINTALONGPATH(Geometry1.Path,0)) for BeginX
and
=GUARD(POINTALONGPATH(Geometry1.Path,1)) for EndX

with the same result.

Does somebody have a alternative idea how to fix my Text exactly to the Start and End of my Line?

Croc

Looks like the protection of calculating the dynamic connector. The width of the connector must be equal to or more than 5 mm.
Follow the formula in cell "Width". At large distances, it is = GUARD (EndX-BeginX).
If the distance becomes less than 5 mm, the formula changes: Width = GUARD (5 mm) or Width = GUARD (-5 mm)
If you change Width, LocPinX is recalculated.
This affects Geometry1.X.

vojo

one way to break the width <=> geo 1 relationship is to do the following

Moveto.x = width*0 + <your calculation>
Moveto.y = height*0 + <your calculation>

For example, say you want a start a line 33mm into the shape

Moveto.x = width*0 + 33mm

The downside to this is if you resize the shape below the delta (e.g. less than 33mm) the line is outside the shape.
(this does work...used it many times myself)

You might be able to play with pinx, piny to make a fixed offset from sheet reference point

moveto.x = width*0 + pinx*locpinx - 33mm

if this works, then line starts 33mm to the left of the sheet reference point for the shape no matter the size of the shape.
(dont know if this works...may need to play with it for behaviors).

vojo

one more thing

You probably should use GUARD around the geometry formulas since, depending on the action, visio will replace with the effective width

moveto.x = width.0 + 10mm = width*0.125

Yacine

If the length musn't be less than 5 mm - ie if it is just a matter of protecting the formulas in your shape, then you may consider the bound function.
Chris has written a nice article about it. http://www.visguy.com/2006/12/14/constraining-angle-with-the-bound-shapesheet-function/
Yacine

novski

if you hit 5mm*2mm to a usercell you get 10 square mm as result.
for a line (or a connector) thats pretty uncool...
is it possible to prevent visio from makeing it to a "x3" expression somehow?

best regards
novski

Yacine

Why would you like that?
It is cool to have a system that recognises units.
If you don't like them, then don't write units in the formula.
If you can't avoid it, then you may multiply the result by the inverse of the unit (/1 mm²)
Yacine

vojo


novski

Is it possible that this "bug" (called so from Wapperdude in the followed post) is related to that inconsistency.

Quote from: novski on September 26, 2014, 07:44:33 AM
I don't understand why the Cell Geometry1.X1 (MoveTo.X) increases to a max of 2.5mm as soon EndX comes closer than 2.5mm towards the 0mm point of Geometry1.X1 from the positive side and the same at
Quote from: wapperdude on September 26, 2014, 03:21:25 PM
Here's the unsatisfying answer... I think you've discovered a bug in the dynamic connector algorithm.  I was able to duplicate the behavior on my pc, starting from a fresh drawing, i.e., I did not copy your file.

But, if you try the same thing with an ordinary line shape, everything behaves properly as expected.

Moral of the story:  don't do this with dynamic connectors.   :o

Wapperdude

Best regards
novski

vojo

so I downloaded your drawing

As far as I can tell, there is nothing remotely related to the numbers you are citing
(closest is the middle thing where you have width = guard(-5mm) and locpinx = 1/2 endx-beginx....but even that should not
matter since you are putting in raw values in the geometry)

I am saying there is not a bug here, but it really looks like the cell settings are way way way off from what you trying to
accomplish.  You have to realize that visio has a really arcane methodology.

not sure what you are trying to accomplish, so

If you want the line end to an constant offset, then geometry1.x1 = guard (width*0 + 3.4968mm)   You need guard to make sure
         recalcs dont overwrite the formula....you need width to make sure you have a reference point

if you want the line end to be a relative offset if greater than X....but have a floor then
         geometry1.x1 = guard(if (endx-beginx > 2.19568mm, width*.1824, width*0+2.33mm))

if you want line end to always be proportional to width then
         user.scale = <original width defined when developing the shape 6 months ago>
         geometry1.x.1 = guard((user.scale/width)*(width*0+4.6673mm))

Based on the shapes, I really dont have a clue what you are trying to accomplish

novski

Hi there
It took me a while to manage what i like to have. I made my Custom Connector and Added some features i like.
I don't understand what vojo means with arcane methodology of visios cell settings. So all i did is tried to fix it somehow... Its in the cell User.BeginPinXdebugVisio. It works well most of the time but from time to time it doesn't  and i can't find out why.
It seams to hapen that if tow connection Points are on the exact same Y-Axis that my BeginPinX jumps 2.5mm in the Y Axis.
The same happens when i make a Offpage reference (right click the Connector) on the directed side it displays my Text -2.5mm.
Im clueless.
I don't know if anybody is interested in helping with something so deeply, but i wold really apreciate...

Best regards
novski

PS: Im Working with Visio Pro 2010.