Below is the example of using the ChangeDimSelection operation to select a group of dictionary elements. The request contains moniker of opened dictionary instance and the element group identifier. The response contains summary information about the selected elements and the moniker of the new instance of the dictionary.
{ "ChangeDimSelection" : { "tDim" : { "id" : "S1!M!S!S1" }, "tArg" :
{ "newInstance" : "true", "setGroup" : { "id" : "GROUP1" }, "elSelectOp" : "Unknown", "elRelative" : "Unknown" } } }
{ "ChangeDimSelectionResult" : { "id" : "S1!M!S!S5", "selectionInfo" : { "firstSelected" :
{ "n" : "Item 2", "a" : { "it" : [ "Item 2", "2", "2", "1",
"A000124" ] }, "ea" : { "it" : [ { "@v" : "Item 2" },
{ "@v" : "2" }, { "@v" : "2" }, { "@v" : "1" }, {
"@v" : "A000124" } ] }, "k" : "2", "h" : "0", "o" : "0" }, "lastSelected" : {
"n" : "Item 3", "a" : { "it" : [ "Item 3", "3", "3", "2", "A000125"
] }, "ea" : { "it" : [ { "@v" : "Item 3" }, {
"@v" : "3" }, { "@v" : "3" }, { "@v" : "2" }, { "@v" : "A000125"
} ] }, "k" : "3", "h" : "0", "o" : "0" }, "selectedCount" : "2" } } }
The specified ApplyGroup function selects dictionary elements according to the specified group of elements. The dictionary instance moniker and the element group identifier are sent as input parameters. The result of the function is the result of the operation.
public static ChangeDimSelectionResult ApplyGroup(DmId moniker, string groupId) { var somClient = new SomPortTypeClient(); //Proxy object for operation execution //Operation execution parameters var tSel = new ChangeDimSelection() { tArg = new DmSelectionArg() { newInstance = true, setGroup = new DmGroupArg() { id = groupId } }, tDim = moniker }; //Selection of group of elements var result = somClient.ChangeDimSelection(tSel); return result; }
See also: