Multiple Ports

I want to create a Node that represents Parallel Processes, and I need to be able to add processes to it. The idea is that it would look something like this.

The black lines are nodes and the red lines are links. I want to add ports to the nodes (Top and bottom) dynamically. Is there an easy way to set the location of the port on the node so it's always even. I can calulate the Y coordinate but how do I pot the port where I want it on the Node?

Check out BarNode in Demo1… I think it’s what you want.

Look on http://www.nwoods.com/go/dotnetfeatures.htm for 2 screenshots, one of Petri Nets and one labeled "BarNodes in 2.3".
In Demo1, if you pick menu "Insert > Network Diagram", you'll see a sample of the BarNode.
Petri Net code is also in Demo1, although there doesn't seem to be any way to create a PetriNet.
Change to insertNetworkDiagramMenuItem_Click.. and you'll get one of each.
protected void insertNetworkDiagramMenuItem_Click(Object sender, EventArgs evt) {
GraphView view = GetCurrentGraphView();
if (view != null) {
view.Doc.InsertNetworkDiagram();
view.Doc.InsertPetriNet(view);
}
}

I have looked at this and it’s not exactly what I am looking for.

I have created the two noed that look like bars. Now I want to be able to programatically create a ports on the bar at points that are calculated based on the number of ports required. The object should start out with two but I want to be able to add more programmatically.
I can add a port no problem but I am having trouble getting the link attached to it to look right. I just want it to come straight down and hook up to a port on the bottom node in the same spot.
I have tried using SetSpotLocation( ) and ust setting the port.Location and fromspot and tospot. But it never looks like a I want it to. I have put the code in the constructor and LayoutChildren which still baffles me.
Please help I'm running out of time on this one.
Dave

Dave,

Why have multiple ports? BarNode/BarPort do this with just 1 port per node. What is it about BarNode that doesn't meet your needs?

I looked at demo1, perhaps I don’t fully understand how it works.
Some of my requirements:
I need all my nodes to inherite from a common ancestor (currently they all inherite from GOTextNode)
I need to add ports programmatically based on a user dropping another node into the digram.
I want the nodes to grow to allow for each link added to the diagram.
The nodes should always start with two links between then and then I’ll add an empty node

I pasted a diagram to help illustrate what I am trying to do. The diagram is always along one base line between Start and End. The user can only drop objects on a green plus sign.
When a Parallel Control Flow operation is dragged into the diagram. It should create the top and bottom bar and two links that represent two parallel processes. I would like them to go from the top bar to the bottom in a straight line.
Then the user can drag operations into the parallel process. If they drop an operation onto the last empty line it should create another process line. Moving the right hand line to the middle. Each time the user puts something on the last empty line it should create another line and make the bars longer to accomodate.

Some of my requirements:
> I need all my nodes to inherite from a common ancestor (currently they all inherit from GOTextNode)

BarNode is derived from GoBasicNode. I don't know how easy it would be to recode it from GoTextNode. It's not that hard to deal with more than 1 type of node in a GoDiagram.

> I need to add ports programmatically based on a user dropping another node into the digram.
BarNode only has 1 BarPort, so that wouldn't appear to be an issue here.

> I want the nodes to grow to allow for each link added to the diagram.
BarNode can be any width.

The nodes should always start with two links between then and then I'll add an empty node
Sure, see the sample usage. (BarNode/BarPort are only a little over 100 lines of code...)