SetCollectionExpressionValue

Syntax

bool SetCollectionExpressionValue(OdId tObject, SetCollectionExpressionValueArg tArg)

Parameters

tObject. Moniker of the unit that is running in debugging mode.

tArg. Operation execution parameters.

Description

The SetCollectionExpressionValue operation changes value of the expression that takes multiple values.

Comments

The operation changes one of the values in array, matrix, or collection. To execute the operation, in the tObject field specify moniker of the object that is in debugging mode, and in the tArg field specify value change parameters.

The operation results in the logical True if the value was changed successfully.

Example

Below is the example of changing matrix value. The request contains moniker of the unit that is running in debugging mode, name of variable with a matrix, coordinates and a new value to be set. The response contains whether the value is successfully changed.

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">
<SetCollectionExpressionValue xmlns="http://www.fsight.ru/PP.SOM.Som">
<tObject xmlns="">
  <id>EDOPGFIAGFBOFOAENKGBHKMMBAJLIDKEDLEKONHMPDMJLCHN!M!305383</id>
  </tObject>
<tArg xmlns="">
  <expression>newMatrix</expression>
<key>
  <it>1</it>
  <it>1</it>
  </key>
  <value>1.234</value>
  </tArg>
  </SetCollectionExpressionValue>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
  <SetCollectionExpressionValueResult 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">1</SetCollectionExpressionValueResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"SetCollectionExpressionValue" :
{
"tObject" :
{
"id" : "EDOPGFIAGFBOFOAENKGBHKMMBAJLIDKEDLEKONHMPDMJLCHN!M!305383"
},
"tArg" :
{
"expression" : "newMatrix",
"key" :
{
"it" :
[
"1",
"1"
]
},
"value" : "1.234"
}
}
}

JSON response:

{
"SetCollectionExpressionValueResult" : "1"
}
public static bool SetCollectionExpressionValue(MbId mb, string modId, string evaluateExpression, string[] coord, string newValue)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tSet = new SetCollectionExpressionValue()
{
tArg = new SetCollectionExpressionValueArg()
{
expression = evaluateExpression
},
// Create object moniker
tObject = new OdId() { id = mb.id + "!" + FindObjectById(mb, modId).k }
};
// Change value
var result = somClient.SetCollectionExpressionValue(tSet);
return result;
}

See also:

Working with Development Environment