Universal Robots Forum

How to detect whether a node is created by copy/cut/paste or by Load Program

The NodeCreationType from CreationContext is set to NEW when a new node is inserted. But it is set to LOAD both when the program is loaded or if it is copied, cut, or pasted. Does anyone have a suggestion to how to detect if it is one or other - whether a node is created by copy/cut/paste or from loading the program?

the only thing i can imagine is having something like an observer, implemented with singleton pattern which gets the creationcontext information of all active urcaps from its initialization method/constructor. Doing so, should give you a list with some (NEW,NEW,LOAD…) infos on runtime, which in this case means the last node was copied, otherwise a list (LOAD,LOAD,LOAD) … means the program was loaded.

Thank you for your answer. However, if a loaded node is copied just after a program is loaded and no NEW nodes have been inserted you would still have (…, LOAD, LOAD, LOAD).