Connecting Two Shape Points

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.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SetWspMd xmlns="http://www.fsight.ru/PP.SOM.Som">
<tWsp xmlns="">
  <id>CIMJHKLEBJECGOAEDDAIHBNBMCJPBEIEDLDBMALGIAOFGHDO!M!S!WSPMCLOGNLEBJECGOAEIIMMCOLKFIOGIGNEPLNLFCEAJGEIEIBG</id>
  </tWsp>
<tArg xmlns="">
<pattern>
  <obInst>true</obInst>
  <parsOwnDefVals>true</parsOwnDefVals>
<action>
  <GlueConnectionPoints>true</GlueConnectionPoints>
  </action>
  </pattern>
<meta>
<GlueConnectionPoints>
  <shapeId1>Shape2</shapeId1>
  <shapeId2>Shape4</shapeId2>
  <Index1>0</Index1>
  <Index2>0</Index2>
  <AutoIndex>true</AutoIndex>
  </GlueConnectionPoints>
  </meta>
  </tArg>
  </SetWspMd>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetWspMdResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id xmlns="">
  <id>CIMJHKLEBJECGOAEDDAIHBNBMCJPBEIEDLDBMALGIAOFGHDO!M!S!WSPMCLOGNLEBJECGOAEIIMMCOLKFIOGIGNEPLNLFCEAJGEIEIBG</id>
  </id>
  <meta xmlns="" />
  </SetWspMdResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"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"
}
}
}
}
}

JSON response:

{
"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:

Working with Workspace