Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Link Routing Question (Read 3629 times)
eblodgett
YaBB Newbies
*
Offline



Posts: 4
Joined: Nov 13th, 2008
Link Routing Question
Nov 13th, 2008 at 8:08pm
Print Post  
I apologize if this has been discussed and/or answered before -- I tried to search and couldn't seem to find anything related to this specific question.

When we programmatically add links to nodes within the diagram the routing is one way - but when I drag a node and move it slightly, the link reroutes itself in a much more smooth pattern.

I am using Bezier and Autoroute = true.  I wish I could provide a picture because a picture would be worth a million words.

I have tried every imaginable setting on the links and wonder if there is a way to simulate the routing methodology that is used by autoroute after moving a node.

Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link Routing Question
Reply #1 - Nov 14th, 2008 at 8:20am
Print Post  
You could call the DiagramLink.Route() method or Diagram.RouteAllLinks().

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
eblodgett
YaBB Newbies
*
Offline



Posts: 4
Joined: Nov 13th, 2008
Re: Link Routing Question
Reply #2 - Nov 14th, 2008 at 4:20pm
Print Post  
We got it to work - the interesting part is that we had to put in this code for it to work:

diagramview1.Update();
diagram1.RouteAllLinks();
diagramview1.Update();

Otherwise it never did the re-routing.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link Routing Question
Reply #3 - Nov 14th, 2008 at 4:43pm
Print Post  
Update only repaints the view, but this should be done automatically by the routing method. Are you handling the LinkRouted event by any chance?
  
Back to top
 
IP Logged
 
eblodgett
YaBB Newbies
*
Offline



Posts: 4
Joined: Nov 13th, 2008
Re: Link Routing Question
Reply #4 - Nov 14th, 2008 at 5:02pm
Print Post  
OK - so much of my problem was I was modifying the BOUNDS within the draw override - I have moved that code out so here's what I have done.  I added a property that defines the 'mode' of the digram.  Inside the set of that property, I modify the bounds AND the anchorpoints.  It works better now, except it's like the anchorpoints are one loop behind when they are drawn.  In other words, it's using the OLD anchorpoints - but if I click on a node and drag it ever so slightly, the anchorpoints immediately switch to the correct ones.  So it's something about timing - any ideas?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link Routing Question
Reply #5 - Nov 16th, 2008 at 8:57am
Print Post  
Do you mean the link end points do not move to the new anchor point positions? That's not done automatically when you change an AnchorPoint coordinates, but the link endpoints are updated when changing node.Bounds. So if you set Bounds after changing the anchor points, it should work ok.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
eblodgett
YaBB Newbies
*
Offline



Posts: 4
Joined: Nov 13th, 2008
Re: Link Routing Question
Reply #6 - Nov 17th, 2008 at 10:42pm
Print Post  
Thanks for the feedback - Actually after some trial and error I ended up moving the bounds change until after the anchorpoints almost accidentally and it works - your suggestion confirmed it - thanks again.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint