Select the nodes programatically

how to select a node or group programatically, I have the keys of node and I need fire an event to make selected that particular node which has that key

If you want to make that node the only selected Part:

myDiagram.select(myDiagram.findNodeForKey(key))

Or, if you do not want to deselect anything:

var n = myDiagram.findNodeForKey(key);
if (n) n.isSelected = true;