bool SetCollectionExpressionValue(OdId tObject, SetCollectionExpressionValueArg tArg)
tObject. Moniker of the unit that is running in debugging mode.
tArg. Operation execution parameters.
The SetCollectionExpressionValue operation changes value of the expression that takes multiple values.
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.
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.
{
"SetCollectionExpressionValue" :
{
"tObject" :
{
"id" : "EDOPGFIAGFBOFOAENKGBHKMMBAJLIDKEDLEKONHMPDMJLCHN!M!305383"
},
"tArg" :
{
"expression" : "newMatrix",
"key" :
{
"it" :
[
"1",
"1"
]
},
"value" : "1.234"
}
}
}
{
"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: