Create two rectangle shapes which are part of a group(group level 1). Each of these group are part of a parent group(group level2).
Create a connector and connect the rectangles. When the diagram is opened, the connector is not connected to rectangles. Move one of the rectangle, and the connector is displayed properly.
When the rectangles are grouped on a single level (the group level 2), the connector is diplayed properly.
What I am missing here ?
// add child shape 1
long shapeId1 = page.DrawRectangle(2, 3, 2, 1);
Shape shape1 = page.Shapes.GetShape(shapeId1);
Aspose.Diagram.Shape[] ss = new Aspose.Diagram.Shape[1] { shape1 };
Shape group1 = page.Shapes.Group(ss);
ss = new Aspose.Diagram.Shape[1] { group1 };
//create group parent
Shape groupParent1 = page.Shapes.Group(ss);
// add child shape 1
long shapeId2 = page.DrawRectangle(5, 3, 2, 1);
Shape shape2 = page.Shapes.GetShape(shapeId2);
ss = new Aspose.Diagram.Shape[1] { shape2 };
Shape group2 = page.Shapes.Group(ss);
//create group parent
ss = new Aspose.Diagram.Shape[1] { group2 };
Shape groupParent2 = page.Shapes.Group(ss);
//create connector
string masterName = “Dynamic connector”;
diagram.AddMaster(stencilFile, masterName);
long connectorId = diagram.AddShape(0, 0, masterName, 0);
Shape connector = page.Shapes.GetShape(connectorId);
page.ConnectShapesViaConnector(shape1, ConnectionPointPlace.Right, shape2, ConnectionPointPlace.Left, connector);