Hi, Walter.
Thank you for your answer.
Can you show me How to get assigned spot?
I think I might be work if getLinkPoint return assigned spot point
and getLinkDirection return angle.
But I don’t know how to get assigned spot before getDocumentPoint.
Is it right what I’m thinking?
var aspot = GET_ASSIGNED_SPOT(); // ???
var op = otherport.getDocumentPoint(aspot);
Here are sample code:
var brush_hex1 = $(go.Brush, go.Brush.Linear, { 0: “#F28226”, 1: “#71BFD2” });
var geom_hex1 = “F M 1,24.879627 C 1,13.833471 9.954669,4.8789997 21.000755,4.8789997 32.045586,4.8789997 41,13.833471 41,24.879627 l 0,0 C 41,35.924526 32.045586,44.878998 21.000755,44.878998 9.954669,44.878998 1,35.924526 1,24.879627 z m 0.00819,0.03099 20.0668205,0.17454 19.860933,-0.2203 M 21.088835,4.9966982 l -0.0055,6.1604398 -0.02013,33.426182”;
<span =“apple-tab-span”="" style=“white-space:pre”> myDiagram.nodeTemplateMap.add(“HeatExchanger01”,
$(go.Node, go.Panel.Auto,
{ locationSpot : go.Spot.Center,
locationObjectName : “SHAPE”, selectionAdorned: false,
resizeObjectName : “SHAPE”, resizable : true,
rotateObjectName : “SHAPE”, rotatable : true,
},
new go.Binding(“location”, “loc”, go.Point.parse).makeTwoWay(go.Point.stringify),
$(go.Panel, go.Panel.Table,
$(go.Panel, go.Panel.Table,
$(go.RowColumnDefinition, {column: 0, row: 1, alignment: go.Spot.Left}),
$(go.RowColumnDefinition, {column: 1, row: 0, alignment: go.Spot.Top}),
$(go.RowColumnDefinition, {column: 2, row: 1, alignment: go.Spot.Right}),
$(go.RowColumnDefinition, {column: 1, row: 2, alignment: go.Spot.Bottom}),
$(go.Shape,
{ geometryString: geom_hex1,
fill: brush_hex1,
name: “SHAPE”, width: 48, height: 48,
stroke: “#000”, strokeWidth: 1,
portId: “”, fromLinkable: true, toLinkable: true,
cursor: “pointer”,
column: 0, row: 0, columnSpan: 2, rowSpan: 2, width: 48, height: 48},
new go.Binding(“desiredSize”, “size”, go.Size.parse).makeTwoWay(go.Size.stringify)),
$(go.Panel, go.Panel.Horizontal, { column: 0, row: 1 }, $(go.Shape, { width: 8, height: 8, figure: “Rectangle”, fill: “blue”, portId: “P_IN01”, toSpot: go.Spot.Left, toLinkable: true,toMaxLinks: 1})),
$(go.Panel, go.Panel.Horizontal, { column: 1, row: 0 }, $(go.Shape, { width: 8, height: 8, figure: “Rectangle”, fill: “blue”, portId: “P_IN02”, toSpot: go.Spot.Top, toLinkable: true,toMaxLinks: 1})),
$(go.Panel, go.Panel.Horizontal, { column: 2, row: 1 }, $(go.Shape, { width: 8, height: 8, figure: “Ellipse”, fill: “red”, portId: “P_OUT01”, fromSpot: go.Spot.Right, fromLinkable: true,fromMaxLinks: 1}))),
$(go.Panel, go.Panel.Horizontal, { column: 1, row: 2 }, $(go.Shape, { width: 8, height: 8, figure: “Ellipse”, fill: “red”, portId: “P_OUT02”, fromSpot: go.Spot.Bottom, fromLinkable: true,fromMaxLinks: 1})))
),
$(go.TextBlock,
{ alignment: go.Spot.Center,
wrap: go.TextBlock.WrapFit, textAlign: “center”,
editable: true, font: font_small, text: “HEX” },
{ column: 0, row: 1 },
new go.Binding(“text”, “text”).makeTwoWay())
)
));