Skip to main content

Reroute a connector

To reroute a connector, use the Reroute method of the IDiagram object. The Reroute method recalculates the routes of all connectors on the diagram. If the route calculation includes orthogonal broken lines, you can speed up the calculation process by simplifying the route calculation by specifying false as an argument.

public void Reroute(ICommandContext c, ICommandParams p) 
{
IDiagram diagram = c.App.Workspace.CurrentEditor as IDiagram;
if (diagram == null)
{
c.App.Window.UI.ShowMessageBox("The current editor is not a diagram.");
return;
}

diagram.Reroute(false);
}