Emulation of GlueTo() with ShapeSheet

Started by econex, November 27, 2017, 11:14:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

econex

I want to connect two shapes with dynamic connector without using standard GlueTo() call in such scenario. How can I emulate GlueTo() call by just changing ShapeSheet formulas?

econex

I figured out that I need to write proper formulas for "BeginX", "BeginY", "EndX", "EndY" cells. Something like.. PAR(PNT(Task.122!Connections.X10,Task.122!Connections.Y10)). Are any additional cells affected or required to touch to achieve exact analogy? Will behavior be exactly equal in cell manupulation and normal GlueTo() usage?

wapperdude

#2
Why are you using formulas?  Visio does this automatically..as long as gluing is enabled.  Drag one connector end to 1st shape, red square appears when glued,  likewise  with the other end and 2nd shape.

Wapperdude
Visio 2019 Pro

econex

I am using C# scripting to automate creation of a complex Visio layout in my VSTO add-on.

wapperdude

#4
Ah.  Wasn't obvious that this was about automating. 

Which version of Visio?

What issues with glueto?  To try and construct shapesheet formulas directly will add work, and dependent on Visio version.

Also, I don't do C#, so can't help you directly.  Just for reference, here's link to simple vba construct using glueto.  Might give you some ideas.  http://visguy.com/vgforum/index.php?topic=7694.msg32714

Wapperdude
Visio 2019 Pro

econex

@wapperdude, Thank you for valuable comments. I m using Visio 2016. Your indication that formulas may differ between Visio versions is serious enough to reject this idea and use standard GlueTo() in API. C# does not matter because essential in this question is exactly usage of formulas. Whatever script writes into ShapeSheet, does not impact final result.

Yacine

What is the problem with glue to?
Editing directly the shapesheet is definitely possible, but more complicated.
GlueTo and GlueToPos shoudl give you all the possibilities needed.

Yacine

Hey Ken

Quote from: econex on November 27, 2017, 11:20:15 AM

I figured out that I need to write proper formulas for "BeginX", "BeginY", "EndX", "EndY" cells. Something like.. PAR(PNT(Task.122!Connections.X10,Task.122!Connections.Y10)). Are any additional cells affected or required to touch to achieve exact analogy? Will behavior be exactly equal in cell manupulation and normal GlueTo() usage?


Econex:

   The short answer is No because there are noticeable differences if you don't use GlueTo.  For example, although the two shapes joined by your PAR(PNT... solution act as if they're connected, they're not truly "connected" in a Visio sense.  This caused me some problems a few years back (solved with assistance from our Wapperdude).  Check out the details at http://visguy.com/vgforum/index.php?topic=6946.msg29023#msg29023.  Not sure if there are other differences.

   Good luck!

   - Ken

Ken V. Krawchuk
Author
No Dogs on Mars - A Starship Story
http://astarshipstory.com

econex

Ken, thank you so much for your valuable insights!