Avoiding node overlap

Hi Walter,
I make several icon nodes with random logic and I’d like to set a node
with position of X,Y value wihtout overlap each other.
Is any method for avoiding nodes overlap ?
Thanks.

Can’t you just assign positions in a loop?
float x = 0;
foreach (GoObject obj in goView1.Document) {
GoNode n = obj as GoNode;
if (n != null) {
n.Left = x;
x += n.Width + 20; // plus spacing
}
}
Another way is to use one of the automatic layout algorithms.
But if you want something more sophisticated that deals with other nodes keeping their current positions, then you’ll need to implement your own policies for deciding where to position nodes so that they don’t overlap.
One way is to search for a rectangular area that is empty of other nodes, by calling GoDocument.IsUnoccupied.