NetDiagram Programmer's Guide
DiagramLink.AutoRoute Property
See Also
 





Gets or sets a value indicating whether a link should avoid nodes by going the shortest path from its origin to its destination without crossing any other nodes.

Namespace: MindFusion.Diagramming
Package: MindFusion.Diagramming

 Syntax

C#  Copy Code

public bool AutoRoute { get; set; }

Visual Basic  Copy Code

Public Property AutoRoute As Boolean

 Property Value

true to route this link; otherwise, false. Initialized with the value of RouteLinks.

 Remarks

If AutoRoute is enabled, a link automatically finds the shortest possible path between its origin and destination that doesn't intersect Obstacle nodes. The number and orientation of the link's segments are updated when the nodes it links are moved around. The positions of end points of a routed link are not changed, unless the link is also set to Dynamic.

It is best to use AutoRoute with links of the Cascading style. Note that automatic routing overrides the RetainForm behavior.

 Performance note

Links whose AutoRoute property is enabled are re-routed if they intersect with newly created nodes. Thus when constructing a large diagram programmatically, each link might be re-routed many times, once for each newly added node whose location arguments collide with link's bounding rectangle. That might slow down diagram creation a lot. To avoid it, first create all nodes, and afterwards the link; that requires a single calculation for each link's route.

 See Also

DiagramLink Members
DiagramLink Class
MindFusion.Diagramming Namespace
RoutingOptions Class
Dynamic Property
SegmentCount Property