T
Tsung-Yuan Liu
I tried to use the DistanceFrom property of the Shape object in Visio to
compute the distances between two shapes.
However, I found that for two shapes A and B, the values for
A.DistanceFrom(B, 0)
and
B.DistanceFrom(A, 0)
are sometimes different.
I opened a new Flowchart (Metric) drawing,
placed two "Process"es next to each other horizontally.
resized one so that they are of different sizes,
and making sure that the top and bottom sides of the two rectangles are not
on a straight line.
Then I tried the code:
Debug.Print
ActiveWindow.Page.Shapes.ItemFromID(1).DistanceFrom(ActiveWindow.Page.Shapes.ItemFromID(2), 0)
Debug.Print
ActiveWindow.Page.Shapes.ItemFromID(2).DistanceFrom(ActiveWindow.Page.Shapes.ItemFromID(1), 0)
and found that they output different values.
Is this normal?
compute the distances between two shapes.
However, I found that for two shapes A and B, the values for
A.DistanceFrom(B, 0)
and
B.DistanceFrom(A, 0)
are sometimes different.
I opened a new Flowchart (Metric) drawing,
placed two "Process"es next to each other horizontally.
resized one so that they are of different sizes,
and making sure that the top and bottom sides of the two rectangles are not
on a straight line.
Then I tried the code:
Debug.Print
ActiveWindow.Page.Shapes.ItemFromID(1).DistanceFrom(ActiveWindow.Page.Shapes.ItemFromID(2), 0)
Debug.Print
ActiveWindow.Page.Shapes.ItemFromID(2).DistanceFrom(ActiveWindow.Page.Shapes.ItemFromID(1), 0)
and found that they output different values.
Is this normal?