How to create multiple ports of a node?

I am trying to draw a flow chart. So far, every node has only one in port and one out port. When there are more than one in-links and out-links, the all go into the node from one port and go out from the node from one port then split.
So I think I need multiple ports so that each link has its own port in stead of sharing one port with other links. Is there any simple method or sample code to do that? Thanks a lot.

What class are you using for your nodes? Are your links always Orthogonal? Where do you expect links to terminate when the node shape is a diamond or some other non-rectangular shape?

The node is GoBasicNode. Its shape is GoRoundedRectangle. It does not matter where the link terminates as long as it points to the target node. Thanks for your reply.

Since you are using GoBasicNode, which has a single GoPort whose FromSpot is NoSpot and whose ToSpot is NoSpot, and since you are saying that all destination links connect at the same point, I’m assuming that your links are indeed Orthgonal.
If they weren’t Orthogonal, they would naturally terminate at the intersection point with the GoBasicNode.Shape.
If your Shapes are always going to be rectangular, then you could replace the GoBasicNode.Port (which is normally a GoPort) with a GoBoxPort. You can either set that GoBasicNode.Port property, or you could (more efficiently) override GoBasicNode.CreatePort. Then if you set the GoBoxPort.LinkPointsSpread property to true, you can see the results.

Thanks for your suggestion. It works!
But once I use Autolayout, all the links go back to one port (or all ports of a node come to one point?). I am using GoLayoutLayeredDigraph. Any suggestion?

After your perform the autolayout, iterate over all of the nodes, get the GoBasicNode.Port as a GoBoxPort, and call the GoBoxPort.UpdateAllLinkPoints() method.
This will cause each link to be re-routed, which might lose some useful routing that the layered-digraph autolayout might have done. That might be OK with you, but if you want to try to keep some of the routing done by the autolayout, you could initialize each link by setting GoLink.AdjustingStyle to be GoLinkAdjustingStyle.End. (This initialization can just be done once – not each time you do an autolayout.)
Using a link adjusting style of End should result in the rerouting caused by GoBoxPort.UpdateAllLinkPoints() to just change the ends of the links, while leaving any middle routing alone.

Thanks a lot. It looks better now.