Dynamic node creation

Hi, i am trying to catch the drop event on canvas and using that i want to add a new device to the canvas along with the one being created.
I am able to catch the drop event by adding listener but when i add the new node in canvas it is not reflected in model and i’am not able to use it.

this is the code i am trying -

the method makeComponent creates a node and i add it using diagram.add().
is there any other way to do this.

You need to be adding a data object to the model, not a Node to the diagram, by calling Model.addNodeData. For examples search the samples for calls to that method.

thanks for the help…