Cmany.zip (24,6 kB)
Hi,
I try to draw connectors with a specified jump style. For this I am using youre new method SetConnectorJumpValue. However, it does not work as expected, it behaves differently acoording to the sequence I am calling it.
When I have the code bellow, the jump is not displayed properly. However, after I open the Visio file and if I move a shape, all the connectors are diplayed with the jump settings:
Shape shape1 = page.Shapes.GetShapeIncludingChild(index1);
Shape shape2 = page.Shapes.GetShapeIncludingChild(index2);
Aspose.Diagram.Shape connector1 = new Aspose.Diagram.Shape();
diagram.AddShape(connector1, connectorMaster, 0);
connector1.SetConnectorJumpValue(ConLineJumpCodeValue.Always, ConLineJumpStyleValue.Arc);
page.ConnectShapesViaConnector(shape1, ConnectionPointPlace.Right, shape2, ConnectionPointPlace.Left, connector1);
The code bellow works properly, when I call the SetConnectorJumpValue method AFTER I connect the shapes:
Shape shape1 = page.Shapes.GetShapeIncludingChild(index1);
Shape shape2 = page.Shapes.GetShapeIncludingChild(index2);
Aspose.Diagram.Shape connector1 = new Aspose.Diagram.Shape();
diagram.AddShape(connector1, connectorMaster, 0);
page.ConnectShapesViaConnector(shape1, ConnectionPointPlace.Right, shape2, ConnectionPointPlace.Left, connector1);
connector1.SetConnectorJumpValue(ConLineJumpCodeValue.Always, ConLineJumpStyleValue.Arc);
Even the code works properly, it is extremly slow when the report contains hundreds of connectors. If you run the code bellow with the attached file, it takes a couple of HOURS to execute, basically it is unusable.
Please, provide a solution fast enough to have connectors diplayed correctly with the coded jump style, even when the reports have hundred of connectors.
string connectorMaster = “Connector”;
Diagram diagram = new Diagram(fileName);
Aspose.Diagram.Page page = diagram.Pages[0];
for (int k = 0; k < 4; k++)
{
int index1 = 1+k;
int index2 = 500-k;
for (int i = 0; i < 49; i++)
{
Shape shape1 = page.Shapes.GetShapeIncludingChild(index1);
if (shape1 == null)
continue;
Shape shape2 = page.Shapes.GetShapeIncludingChild(index2);
if (shape2 == null)
continue;
Aspose.Diagram.Shape connector1 = new Aspose.Diagram.Shape();
diagram.AddShape(connector1, connectorMaster, 0);
page.ConnectShapesViaConnector(shape1, ConnectionPointPlace.Right, shape2, ConnectionPointPlace.Left, connector1);
connector1.SetConnectorJumpValue(ConLineJumpCodeValue.Always, ConLineJumpStyleValue.Arc);
index1 += 10;
index2 -= 10;
}
}
// Save visio diagram
diagram.Save(fileName, SaveFileFormat.Vsdx);