I am trying to clone a symbol and add it to a diagram. The node is getting added to the diagram ok but the centerport location of the cloned symbol is set to 0,0 so when I try to link to it the link is coming from 0,0 on the diagram not the centerport of the symbol. Example program attached that copies nodes from one diagram to another and then a button that activates the link tool.
Is there a work around or a better way to do this?
I found my answer for any that have a similar problem. The CenterPort parent needs to be set to the node. So i have
newNode = node.Clone()
newNode.CenterPort.Parent = newNode
This fixes the CenterPort of having a location of 0,0.