Pasting data into diagram

Hi Walter i wanted to ask that, i used

  myDiagram.model.copyNodeDataFunction

but how do i paste the node data into the canvas,

My Purpose: I want to copy some node data but before pasting the node data into the canvas, i want to make some changes(like changing the coordinates before pasting). so i was using the above function to do so. But paste is not working

For paste i used default Ctrl+v

Do correct me if im reading that right, that the above function is being used for copying and pasting.

Please understand the distinction between ctrl-C/ctrl-V copy-and-paste, CommandHandler.copySelection and pasteSelection, and the copying of data Objects for a model. The former does use the latter, but therd are many uses of the latter without involving the former.

If you just want to add a node to your diagram, it would be best to call Model.addNodeData to add a JavaScript Object to the diagram’s model. But each node must be a unique Object (i.e. different object in memory) so if you have an archetype Object, you need to copy it so that you can add the copy to the model. You can do that copying however you would like, but the standard way used by other facilities that copy data (such as copy-and-paste and drag-and-drop) is to call Model.copyNodeData.