GoGeneralNodePort Custom Position

I am having problems with the orientation of GoGeneralNodePorts on a GoGeneralNode. Here’s my problem:

1. I have a Windows Form that allows a user to import a bitmap and add GoGeneralNodePorts to the bitmap (refer to “Image1”)

Image1 (notice the two triangular ports on the left/right side of the bitmap)

2. After the user clicks the “Add” button, the bitmap (and the ports) are serialized and placed into another Windows Form that contains a GoPalette (refer to Image2)


3. Notice that the ports in Image2 are not in the same location as the ports in Image1. I can't figure out why the GoGeneralNodePorts don't "stick" in the same spot as the user defined (in Image1).

Anybody got some ideas/tips?

How did you add the ports to the node?
If you added them by just using GoGroup.Add, then the GoGeneralNode wouldn’t know about those ports, since the LayoutChildren method just positions the “LeftPorts” and “RightPorts”, along with any corresponding port labels. This is useful when you want to add some ports that are not lined up along the left or right sides of the icon.
But if you call GoGeneralNode.AddLeftPort or InsertLeftPort (or the corresponding “…Right…” methods), the node will automatically position them since they will be part of one of the node’s lists of ports.

Another question: why did you serialize and deserialize the node? Could you have just copied the node into the other Form’s GoPalette by doing something like:
otherForm.goPalette1.Document.CopyFromCollection(thisForm.go View1.Selection)