//enabling for model
this.diagram1.Model.LineRoutingEnabled = true;
//enabling for link object
link.LineRoutingEnabled = true;
this.diagram1.Model.LineRouter.DistanceToObstacles = 20;
this.diagram1.Model.LineRouter.RoutingMode = RoutingMode.Automatic; |
OrgLineConnector connector = new OrgLineConnector(new System.Drawing.PointF(10, 200), new System.Drawing.PointF(300, 250));
// Here cp1 and cp2 are connection point
cp.TryConnect(connector.HeadEndPoint);
cp1.TryConnect(connector.TailEndPoint);
connector.HeadingHead = CompassHeading.East;
connector.HeadingTail = CompassHeading.West;
diagram1.Model.AppendChild(connector); |