Visio Guy

Visio Discussions => Programming & Code => Topic started by: m_vijayreddy on March 14, 2009, 12:25:31 PM

Title: Dynamic connector Overlapping Issue
Post by: m_vijayreddy on March 14, 2009, 12:25:31 PM
   I am using dynamic connector to connect to different  shapes from a single shape based on some conditions in programming in C#. Now my problem is overlapping of Dynamic connectors.
Is there any way we can have some spacing between the connectors?
The below piece of code gets executed every time to connect two shapes dynamically.
Thanks in Advance.Help would be greatly appreciated.

private void GetShapesToConnect(Microsoft.Office.Interop.Visio.Shape shpFrom, Microsoft.Office.Interop.Visio.Shape shpTo, String ControlValue)
        {
           
                vStencil = axDrawingControl1.Document.Application.Documents.OpenEx(Application.StartupPath + @"\Simpleflowchart.vsd", (short)Microsoft.Office.Interop.Visio.VisOpenSaveArgs.visOpenHidden);
                Microsoft.Office.Interop.Visio.Page pg = shpFrom.ContainingPage;
                Microsoft.Office.Interop.Visio.Master vMasterConnector = null;
                Microsoft.Office.Interop.Visio.Shape vShape = null;
                vMasterConnector = vStencil.Masters["Dynamic Connector"];
                vShape = pg.Drop(vMasterConnector, 0, 0);

                vShape.get_CellsU("BeginY").GlueTo(shpFrom.get_CellsU("AlignTop"));
                vShape.get_CellsU("EndY").GlueTo(shpTo.get_CellsU("AlignTop"));
                vShape.Text = ControlValue;


        }