I need get link point to json format

hi
i have flowchart and i need get link.point in json format
i can get link.points in mouse enter event when flowchart loading
here is the points format
166,103.95,166,113.95,166,145.5,3.0000000000000284,145.5,3.0000000000000284,177.05,3.0000000000000284,187.05
but when i add new link or move link points format change toList(Point)#17006
so how i can get List(Point)#17006 format to json like that 166,103.95,166,113.95,166,145.5,3.0000000000000284,145.5,3.0000000000000284,177.05,3.0000000000000284,187.05
without save and reload the mydiagram ?

here is my link code
myDiagram.linkTemplate =
$(go.Link,
{
routing: go.Link.AvoidsNodes,
curve: go.Link.JumpOver,
corner: 5, toShortLength: 4,
relinkableFrom: true,
relinkableTo: true,
reshapable: true,
resegmentable: true,

          mouseEnter: function(e, link) { link.findObject("HIGHLIGHT").stroke = "rgba(30,144,255,0.2)"; showPoint(link.location);
         
         
           var elt = document.getElementById("P18_FROMID");
           var elt2 = document.getElementById("P18_TOID");
           var elt3 = document.getElementById("P18_FROMPORT");
           var elt4 = document.getElementById("P18_TOPORT");
            var elt5 = document.getElementById("P18_LINKPOINT");
            elt.value =link.data.from;
            elt2.value =link.data.to;
            elt3.value =link.data.fromPort;
            elt4.value =link.data.toPort;                        
            elt5.value =link.data.points;
                                        } ,
          mouseLeave: function(e, link) { link.findObject("HIGHLIGHT").stroke = "transparent"; }
        },
        new go.Binding("points").makeTwoWay(),
        $(go.Shape, 
          { isPanelMain: true, strokeWidth: 8, stroke: "transparent", name: "HIGHLIGHT" }),
        $(go.Shape, 
          { isPanelMain: true, stroke: "gray", strokeWidth: 2 }),
        $(go.Shape, 
          { toArrow: "standard", stroke: null, fill: "gray"}),
        $(go.Panel, "Auto", 
          { visible: false, name: "LABEL", segmentIndex: 2, segmentFraction: 0.5},
          new go.Binding("visible", "visible").makeTwoWay(),
          $(go.Shape, "RoundedRectangle",
            { fill: "#F8F8F8", stroke: null }),
          $(go.TextBlock, "Yes", 
            {
              textAlign: "center",
              font: "10pt helvetica, arial, sans-serif",
              stroke: "#333333",
              editable: true
            },
            new go.Binding("text").makeTwoWay())
        )
      );

thanks for reply

The value of Link.points is always a List of Points.

Model.toJson will write out an Array of numbers if the property is named “points” and if the value is a List of Points.

So as far as I understand your sitation, calling Model.toJson is already doing what you want.

i use Model.tojson but i need only one link point to json format
other way i need convert List(Point)#17006 to anythings like it 166,103.95,166,113.95,166,145.5,3.0000000000000284,145.5,3.0000000000000284,177.05,3.0000000000000284,187.05

I’m having a hard time understanding what you are writing.

Model.toJson renders the Link.points List of Points as an Array of numbers. (Actually an Array of pairs of number.)

So you should be getting:

"points": [166,103.95,166,113.95,166,145.5,3.0000000000000284,145.5,3.0000000000000284,177.05,3.0000000000000284,187.05]

but with square brackets to make it an Array.

how can i use Model.tojson?

I thought you said you were already calling Model.toJson in order to serialize your model as text in JSON format.

I think you need to describe your situation more carefully and explain exactly what you are doing and how. Then explain what you do want. Explaining why would help too.

yes i use but it’s not working