We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Orthogonal Links

Hi, I read that it is possible to make orthogonal connections using Syncfusion (http://www.syncfusion.com/Products/features.aspx?t=589). It is mentioned that "The new Line Routing and Line Bridging feature provides automatic routing and bridging of orthogonal links around the nodes present on a diagram. Line routing and line bridging can be enabled for new as well as existing diagrams. When line routing is enabled on the diagram model and a link created between two symbols, the line router tries to determine the route between the nodes that offers the fewest obstacles, and generates the link using that optimal path. The default line router can be subclassed and extended by developers who wish to implement custom routing strategies to suit their application needs." However, I am unable to see this feature in the Syncfusion version (3.3.0.10). How can I use this feature? Are all connection between nodes orthogonal connections by default, or are there other changes I need to make? Can you please provide a small code example? Regards, Vinod

3 Replies

AD Administrator Syncfusion Team December 1, 2005 09:33 PM UTC

Hi Vinod, The Essential Diagram v 3.3.0.10 and later releases features the Model.LineRoutingEnabled and Model.LineBridgingEnabled properties that you can turn on to enable the automatic line routing and line bridging for orthogonal links. You can view and edit these properties through the diagram property grid control, as demonstrated in the DiagramBuilder or some of the other sample applications, or by directly applying the properties on the diagram Model. As for creating orthogonal links, if you are using the interactive LinkTool to create your connections, then this can be done by specifying the OrthogonalLine as the line type to be used for the tool''s link factory. This is demonstrated in the DiagramForm.cs file of the DiagramBuilder sample. For the programmatic approach, you can directly create a link using the OrthogonalLine shape, and use this with the LinkCmd. This is demonstrated in the NetworkFlowModel sample that is installed as a part of the 3.3.0.10 update, // To Create an orthogonal link Between two Symbols LinkCmd linkcommand = new LinkCmd(); Link serverlink = new Link(Link.Shapes.OrthogonalLine); linkcommand.Link = serverlink; // Set up the source and target ports for the link linkcommand.SourcePort = server.CenterPort; linkcommand.TargetPort = server1.CenterPort; // Execute the command to connect the two symbols this.diagram1.Controller.ExecuteCommand(linkcommand); Thanks, Prakash Surendra Syncfusion Inc.,


PC Pradip Caulagi December 7, 2005 05:25 AM UTC

Hello Prakash! Thanks for your reply. I have a couple of questions more. > >The Essential Diagram v 3.3.0.10 and later releases features the Model.LineRoutingEnabled and Model.LineBridgingEnabled properties that you can turn on to enable the automatic line routing and line bridging for orthogonal links. You can view and edit these properties through the diagram property grid control, as demonstrated in the DiagramBuilder or some of the other sample applications, or by directly applying the properties on the diagram Model. > >As for creating orthogonal links, if you are using the interactive LinkTool to create your connections, then this can be done by specifying the OrthogonalLine as the line type to be used for the tool''s link factory. This is demonstrated in the DiagramForm.cs file of the DiagramBuilder sample. I have looked at the diagram builder application that you talk about. I tried to create a few orthogonal connections between different electrical symbols. However, the connections cut-across (went-through) the other electrical symbols. Is there a way to avoid cutting-across symbols when making connections? > >For the programmatic approach, you can directly create a link using the OrthogonalLine shape, and use this with the LinkCmd. This is demonstrated in the NetworkFlowModel sample that is installed as a part of the 3.3.0.10 update I can''t get the NetworkFlowModel to build. I get the following errors - c:\program files\syncfusion\essential studio\3.3.0.10\windows\diagram.windows\samples\in depthetworkflowmodel\cs\form1.cs(202,4): error CS0117: ''Syncfusion.Windows.Forms.Diagram.Model'' does not contain a definition for ''HeaderFooterData'' c:\program files\syncfusion\essential studio\3.3.0.10\windows\diagram.windows\samples\in depthetworkflowmodel\cs\form1.cs(203,4): error CS0117: ''Syncfusion.Windows.Forms.Diagram.Model'' does not contain a definition for ''HeaderFooterData'' c:\program files\syncfusion\essential studio\3.3.0.10\windows\diagram.windows\samples\in depthetworkflowmodel\cs\form1.cs(1109,10): error CS0117: ''Syncfusion.Windows.Forms.Diagram.Symbol'' does not contain a definition for ''Layer'' I tried commenting the lines containing HeaderFooterData and that seemed to resolve the problem. How can I solve the problem with ''Layer'' not being found? What am I missing? Many thanks and regards, Pradip


AD Administrator Syncfusion Team December 8, 2005 10:41 PM UTC

Pradip, The DiagramBuilder and other samples have the LineRoutingEnabled and LineBridgingEnabled properties turned off by default. Please make sure that you enable the two properties before creating your orthogonal links. That being said, you will have to bear in mind the line routing strategy will do its best to estimate the optimal path between symbols that does not cut through existing symbols. This, by no means, is a failsafe algorithm, and there will be cases when the routing strategy is unable to arrive at a path that works around all nodes. It is specifically for such cases that we are providing the new line segment editing functionality. Line segment editing will let you select individual segments of an orthogonal link by clicking on it, and move the segment to a more suitable location. This functionality is featured in the new Essential Diagram v4.1.0.0 beta, and can be viewed in the DiagramBuilder sample. From the 4.1.0.0 Release Notes for Essential Diagram: Essential Diagram now supports interactive editing of orthogonal lines and links. The orthogonal line editing functionality is available through the new Syncfusion.Windows.Forms.Diagram.LineSegmentTool interactive tool, and the new Syncfusion.Windows.Forms.Diagram.MoveLineSegmentCmd command class. The LineSegmentTool can be used for interactively editing the segments of an orthogonal link, while the MoveLineSegmentCmd can be used to programmatically achieve the same. Line segment editing can be viewed with the DiagramBuilder sample. Regarding your compilation error, it looks like the sample is incorrectly linking to the 3.3.0.0 version of the Diagram.Base and Diagram.Windows assemblies instead of the 3.3.0.10 version. Please make sure that your GAC and VS.NET Public Assemblies have been correctly updated with the 3.3.0.10 version of the Syncfusion dlls, and the sample correctly links to them. This forum post provides a bit of detail on some of the assembly related mishaps to look out for when running 3.3.0.10 alongside the 3.3.0.0 release - http://www.syncfusion.com/Support/forums/message.aspx?MessageID=35944. An option would be for you to simply remove the 3.3.0.10 update, and move to the 4.1.0.0 beta instead. Thanks, Prakash Surendra Syncfusion Inc.,

Loader.
Live Chat Icon For mobile
Up arrow icon