Create Dangling Link

I am trying to create a link that goes to a port but comes from nowwhere. Here is the code I am using:

Dim MyInletWSLink As WaterLink = New WaterLink MyInletWSLink.ToPort = MyEcon.TopInPort MyInletWSLink.FromPort = Nothing PF.govMain.Document.Add(MyInletWSLink)
Unfortunately the ToPort won't connect. If I do put in a port in the MyInletWSLink.FromPort it links up fine to both ports.
I would also like to know how to define where the From end of the link be positioned on the GoView.

UpdateRoute can’t run without ports on both ends, so there is no path for the link. You can add a couple of points:



testlink.AddPoint(10, 10);

testlink.AddPoint(testnode.GetLeftPort(1).GetToLinkPoint(testlink));



works for me. (in addition to your code)



For those interested here is the code I used and what it looks like.

WaterLink is an Inherited GoLabeledLink with orthogonal=true
govMain is my main GoView
Dim MyInletWSLink As WaterLink = New WaterLink MyInletWSLink.RealLink.ClearPoints() Dim MyPoint As Drawing.PointF Dim MyPoint1 As Drawing.PointF MyPoint = MyEcon.GetLeftPort(1).GetToLinkPoint(MyInletWSLink) MyPoint1 = MyPoint MyPoint1.X = MyPoint1.X - 60 MyPoint1.Y = MyPoint1.Y - 40 MyInletWSLink.RealLink.AddPoint(MyPoint1) MyPoint.X = MyPoint.X MyPoint.Y = MyPoint.Y - 40 MyInletWSLink.RealLink.AddPoint(MyPoint) MyInletWSLink.RealLink.AddPoint(MyEcon.GetLeftPort(1).GetToLinkPoint(MyInletWSLink)) PF.govMain.Document.Add(MyInletWSLink)