How to Get layers in MakeSVG

If i am exporting the diagram in SVG do we get the layers information in it?
May be a different <g> group for every layer.
And how to get layer information in Model

Good question. We don’t currently group by layer unfortunately, but you can easily inspect the <g> of each Part and do something according to layer:

    myDiagram.makeSVG({
      elementFinished: function(obj, svgelem) {
        if (!(obj instanceof go.Part)) return; // only look at parts
        console.log(obj.layerName);
        // Mark this Part as being in a layer, perhaps for styling reasons, etc
      }
    });

Will that work for you? Or do you really need to group them?