Author Topic: MoveTo.X increases when End.X gets closer  (Read 7110 times)

0 Members and 1 Guest are viewing this topic.

novski

  • Full Member
  • ***
  • Posts: 182
MoveTo.X increases when End.X gets closer
« on: September 26, 2014, 02:44:33 AM »
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3856
  • Ideas Visio-lized into solutions
Re: MoveTo.X increases when End.X gets closer
« Reply #1 on: September 26, 2014, 10:21:25 AM »
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

  • Hero Member
  • *****
  • Posts: 1061
Re: MoveTo.X increases when End.X gets closer
« Reply #2 on: September 29, 2014, 01:53:43 AM »
Maybe it has sth. do to with the routing settings and the minimal distance between shapes?

novski

  • Full Member
  • ***
  • Posts: 182
Re: MoveTo.X increases when End.X gets closer
« Reply #3 on: September 29, 2014, 08:12:28 AM »
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

  • Sr. Member
  • ****
  • Posts: 259
    • Visioport
Re: MoveTo.X increases when End.X gets closer
« Reply #4 on: September 29, 2014, 10:33:43 AM »
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

  • Hero Member
  • *****
  • Posts: 1538
Re: MoveTo.X increases when End.X gets closer
« Reply #5 on: September 30, 2014, 08:01:38 AM »
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

  • Hero Member
  • *****
  • Posts: 1538
Re: MoveTo.X increases when End.X gets closer
« Reply #6 on: September 30, 2014, 08:03:19 AM »
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

  • Hero Member
  • *****
  • Posts: 2714
Re: MoveTo.X increases when End.X gets closer
« Reply #7 on: September 30, 2014, 12:17:59 PM »
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

  • Full Member
  • ***
  • Posts: 182
Re: MoveTo.X increases when End.X gets closer
« Reply #8 on: October 17, 2014, 06:13:12 PM »
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

  • Hero Member
  • *****
  • Posts: 2714
Re: MoveTo.X increases when End.X gets closer
« Reply #9 on: October 18, 2014, 01:37:25 AM »
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

  • Hero Member
  • *****
  • Posts: 1538
Re: MoveTo.X increases when End.X gets closer
« Reply #10 on: October 18, 2014, 12:06:58 PM »
divide by 1mm

novski

  • Full Member
  • ***
  • Posts: 182
Re: MoveTo.X increases when End.X gets closer
« Reply #11 on: October 19, 2014, 08:14:56 AM »
Is it possible that this "bug" (called so from Wapperdude in the followed post) is related to that inconsistency.

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

  • Hero Member
  • *****
  • Posts: 1538
Re: MoveTo.X increases when End.X gets closer
« Reply #12 on: October 19, 2014, 12:06:51 PM »
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

  • Full Member
  • ***
  • Posts: 182
Re: MoveTo.X increases when End.X gets closer
« Reply #13 on: November 25, 2014, 07:40:15 AM »
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.