This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Is it possible to create a custom connection line with a alternative route like below? |
|
|
Hello, You can customize the way connections are routed by implementing the IPathfinder interface. The single method to implement here will give you the connection model to be routed, and the entire diagram model that can be used to find the positions of the nodes. The method is to return the X,Y points that make up the routed connection including the start and end points. To get the diagram to use your custom pathfinder, you'll need to have a custom connection that extends DiagramConnection and override the Pathfinder property to return an instance of the pathfinder you want the connection to be routed with. Please let me know if you have further questions about any of this as you work on it. -Jason Fauchelle |
|
|
Hi' Jason I already have a custom connection class that extends DiagramConnection, but I'm still a little bit confused........ Regards, Michael |
|
|
Hi Michael, Sure thing, I'll send you a simple example first thing tomorrow. -Jason Fauchelle |
|
|
Thanks, |
|
|
Hi Michael, I've attached a minimal sample that demonstrates what I explained above - to get a custom connection to use custom routing logic. To run the sample, make sure to add a reference to your copy of the diagramming dll. When running the sample, you'll see that the connection between the two nodes is routed directly from the source point to the destination point, rather than having an elbow as produced by the default pathfinder. This has been achieved simply by overwriting the Pathfinder property of the custom connection to return a custom pathfinder instance. Within the custom pathfinder, all I've done is return the source and destination positions in a list to create that simple path. In your own custom pathfinder, you now have full control of routing the connection any way you want. The connection path will follow whatever list of points you return. To route around nodes, you can use the given IDiagramModel instance to see the positions of all the nodes in the diagram. Let me know if you have further questions. -Jason Fauchelle |
|
|
Hi' Jason Thanks for your demo/sample, it's a great help! Regards, Michael |
|