Getting positions of all the nodes of a diagram

Hi,
We are having a diagram with multiple nodes and links.We are using a customized tree layout.
We want to get the positions (X,Y) of the each node related to the diagram.
and width and height of the each node.

You want to have a TwoWay Binding on the Part.location of your Node template(s). Read http://gojs.net/latest/intro/dataBinding.html. There are lots of examples of this throughout the samples – just search for Binding("location" that also has a call to Binding.makeTwoWay.

Are you sure that you need to save the width and height of each node? Normally you should let the node template determine the actual width and height. But if you are programmatically changing the size of some element of the node (including the whole Node), including allowing the user to manually resize an element (if Part.resizable is set to true), then you’ll want to add a TwoWay Binding of the GraphObject.desiredSize of the element that is resized. Read http://gojs.net/latest/intro/tools.html. There are examples of this in the samples too.