Below is the example of using the SetWspMd operation for connecting a shape point and a connecting line point. The request contains shape identifiers, connecting lines, and indexes of connected points. The response contains no additional information.
{
"SetWspMd" :
{
"tWsp" :
{
"id" : "CIMJHKLEBJECGOAEDDAIHBNBMCJPBEIEDLDBMALGIAOFGHDO!M!S!WSPMCLOGNLEBJECGOAEIIMMCOLKFIOGIGNEPLNLFCEAJGEIEIBG"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"parsOwnDefVals" : "true",
"action" :
{
"GlueConnectionPoints" : "true"
}
},
"meta" :
{
"GlueConnectionPoints" :
{
"shapeId1" : "Shape2",
"shapeId2" : "Shape4",
"Index1" : "0",
"Index2" : "0",
"AutoIndex" : "true"
}
}
}
}
}
{
"SetWspMdResult" :
{
"id" :
{
"id" : "CIMJHKLEBJECGOAEDDAIHBNBMCJPBEIEDLDBMALGIAOFGHDO!M!S!WSPMCLOGNLEBJECGOAEIIMMCOLKFIOGIGNEPLNLFCEAJGEIEIBG"
},
"meta" : ""
}
}
public static SetWspMdResult WspConnectShapes(string moniker, string shape , int poinIndex, string link, int linkPointIndex)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tSet = new SetWspMd()
{
tArg = new SetWspMdArg()
{
pattern = new WspMdPattern()
{
action = new IWrspWorkspaceAction()
{
GlueConnectionPoints = true
}
},
meta = new WspMd()
{
GlueConnectionPoints = new WspGlueConnectionPointsArgs()
{
shapeId1 = shape,
Index1 = poinIndex,
shapeId2 = link,
Index2 = linkPointIndex,
AutoIndex = true
}
}
},
tWsp = new WspId() { id = moniker }
};
// Connect points
var tResult = somClient.SetWspMd(tSet);
return tResult;
}
See also: