Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Autoroute for new links (Read 2557 times)
mr.brick
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Dec 16th, 2008
Autoroute for new links
Jan 7th, 2009 at 1:54pm
Print Post  
Hello,

I am experiencing a slightly unexpected behavior when working with autoroute diagram links.

I want to enable autoroute for certain types of diagram links. I want those links to be routed at all times. When such a link is created I set its AutoRoute property to true. I would expect the link to be routed when created, but it is not. The corresponding node must be moved so the autorouting kicks in.

To auto route after a link is created I also tried to call DiagramLink.Route. This method returns false, and routing isn't performed.

The following is the code used to create the autorouted links:
[code]
DiagramLink result = Diagram.Factory.CreateDiagramLink(origin, destination);
result.AllowMoveEnd = false;
result.AllowMoveStart = false;
result.Style = LinkStyle.Bezier;
result.Dynamic = true;
result.HeadShape = ArrowHead.Arrow;
result.SnapToNodeBorder = true;
result.AutoRoute = true;
[/code]

My question is, how to create a diagram link and have it autorouted?

Thanks!
Hynek Cihlar
BoldBrick, s.r.o.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Autoroute for new links
Reply #1 - Jan 7th, 2009 at 2:27pm
Print Post  
Route() returns false if it fails to find a path. If there is some large node in the background, check how the method works with that node's Obstacle property set to false. Additionally, routing might fails if the distance between origin and destination is smaller than RoutingOptions.GridSize, so try setting smaller GridSize or placing the two nodes at a greater distance from each other.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
mr.brick
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Dec 16th, 2008
Re: Autoroute for new links
Reply #2 - Jan 7th, 2009 at 2:50pm
Print Post  
I start with an empty diagram and 2 nodes. No obstacle node is in the background.

The links are autorouted fine when moving (dragging) their respective nodes, so I don't think the GridSize is a problem.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Autoroute for new links
Reply #3 - Jan 7th, 2009 at 2:55pm
Print Post  
Are both the origin and destination nodes added to the diagram before you call Route? Could you email a small project that reproduces the problem to support@mindfusion.eu?

Stoyan
  
Back to top
 
IP Logged
 
MUDO
Junior Member
**
Offline



Posts: 90
Joined: Nov 29th, 2008
Re: Autoroute for new links
Reply #4 - Feb 18th, 2009 at 11:47pm
Print Post  
Hi!

I have the same problem.

My settings:

Me.Bounds = New System.Drawing.Rectangle(100, 50, 1300, 800)


'Me.Diagram.AllowUnanchoredLinks = False 'mozem pricapit links na shape bez anchorpoints

Me.Diagram.CellFrameStyle = CellFrameStyle.None

Me.Diagram.EnableStyledText = True

Me.Diagram.SnapToAnchor = SnapToAnchor.OnCreateOrModify 'akosi v nich nevidim rozdiel Sad

'Me.Diagram.RoutingOptions.TriggerRerouting = RerouteLinks.WhileCreating

Me.Diagram.ShowAnchors = ShowAnchors.Auto


Me.DiagramView.Behavior = Behavior.DrawLinks 'Defines values that specify how the component responds to actions performed by the user

Me.DiagramView.ModificationStart = ModificationStart.AutoHandles 'Specifies how the user can start modifying an item = aby sa nemusel oznacovat shape pred jeho hybanim


Me.MoOrto.Anchoring = Anchoring.Reassign

Me.MoOrto.BaseLayout = MindFusion.Layout.BaseLayout.Custom


'Me.Diagram.TablesScrollable = True

Me.Diagram.TableBrush = New LinearGradientBrush(Color.White, Color.Green, 45)

Me.Diagram.TablePen = New Pen("0/#FF696969/0/0/0//0/0/10/")

Me.Diagram.TableCustomDraw = CustomDraw.Additional

Me.Diagram.TableStyle = TableStyle.RoundedRectangle

Me.Diagram.TableHandlesStyle = HandlesStyle.EasyMove

Me.Diagram.TableConnectionStyle = TableConnectionStyle.Table

Me.Diagram.TableRowHeight = 5.0!

Me.Diagram.TableColumnWidth = 4.0!


Me.Diagram.LinkBrush = New SolidBrush("#FFFFFFFF")

Me.Diagram.LinkPen = New Pen("0/#FF696969/0/0/0//0/0/10/")

Me.Diagram.LinkCustomDraw = CustomDraw.Additional 'Gets or sets the type of custom drawing performed on this link

Me.Diagram.LinkStyle = LinkStyle.Cascading

Me.Diagram.LinksSnapToBorders = True


Me.Diagram.LinkHeadShape = ArrowHead.None

Me.Diagram.LinkTextStyle = LinkTextStyle.OverLongestSegment

Autorouting is performed after moving shapes Sad
Help?


...MUDO...
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Autoroute for new links
Reply #5 - Feb 19th, 2009 at 8:54am
Print Post  
Hi,

Please save to diagram that has this problem as XML and email it to support@mindfusion.eu.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Autoroute for new links
Reply #6 - Feb 21st, 2009 at 12:48pm
Print Post  
Hi,

The Diagram.RouteLinks property from the file you emailed us is set to false. The AutoRoute property of links is initialized from it, so set it to true to enable auto-routing of new links.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
MUDO
Junior Member
**
Offline



Posts: 90
Joined: Nov 29th, 2008
Re: Autoroute for new links
Reply #7 - Feb 21st, 2009 at 1:13pm
Print Post  
Thanx!


...MUDO...
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint