Number nodes with the same type


I want to number nodes that have the same type with a unique number.
I know there is PartID, but I want a number per node type, like function1 function2, … , decision1, decision2 …

I tried to put into my own nodes constructor and tried to overload Document.Add() but nothing of this is called when a new node is dragged from the palette.

Any idea how to solve this? Thanks in advance,

(I use GoDiagramm Express)

Look at what the ProtoApp sample does in GraphNode (the Start and Stop nodes under the “Special” branch in the Tree Palette).

It catches new node creation in OnLayerChanged, and has a routine that creates a unique name (based on label prefix).

Hi Jake,

thank you very much for the fast and professional support!

btw: Is there a way to avoid adding a specific node from the panel, ie if the node is allowed once only?

see if this helps:

[QUOTE=Jake]see if this helps:[/quote]


that really solves my problem! Big%20smile
My lack was that I needed a point where I could validate those things.

Thank you very much!