Below is the example of using the GetMs operation to open a model. The request contains an instance of opened modeling container and a pattern for opening the model. The response contains the opened model.
{
"GetMs" :
{
"tMs" :
{
"id" : "GEGBFKLHGPMOFOAEIMFEBNKILLAKNJBEIKKFGPFLECLAJIMA!M!S!CEDFMNBMHGPMOFOAEEOKCHDKLPKPFFKNEILBKMMPKNGGGFEEE"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"scenarios" : "Get",
"period" : "true",
"item" :
{
"key" : "306669",
"model" :
{
"transform" :
{
"inputs" : "Get",
"outputs" : "Get",
"kind" : "true"
}
}
}
}
}
}
}
{
"GetMsResult" :
{
"id" :
{
"id" : "GEGBFKLHGPMOFOAEIMFEBNKILLAKNJBEIKKFGPFLECLAJIMA!M!S!CEDFMNBMHGPMOFOAEEOKCHDKLPKPFFKNEILBKMMPKNGGGFEEE"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "key 306480",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "6",
"@hf" : "0",
"i" : "MODELSPACE",
"n" : "Modeling container",
"k" : "306480",
"c" : "5121",
"p" : "1580",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0",
"isPermanent" : "1",
"isTemp" : "0"
}
},
"dirty" : "0",
"period" :
{
"start" : "1968-12-08",
"end" : "2022-12-31"
},
"scenarios" :
{
"nodes" :
{
"it" :
{
"@isFolder" : "0",
"k" : "306497",
"id" : "OBJ306497",
"n" : "Basic",
"vis" : "1",
"scenDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "2",
"@hf" : "0",
"i" : "OBJ306497",
"n" : "Basic",
"k" : "306497",
"c" : "5124",
"p" : "306485",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0"
},
"internalKey" : "306497"
}
}
},
"item" :
{
"k" : "306669",
"id" : "OBJ306669",
"n" : "Model",
"vis" : "1",
"type" : "Problem"
}
}
}
}
public static MsItem GetMsOpenModel(MsId ms, uint modelKey)
{
// Set operation execution parameters
var getMsOp = new GetMs()
{
tArg = new GetMsArg()
{ // Set general data extraction pattern
pattern = new MsMdPattern()
{
scenarios = ListOperation.Get,
period = true,
item = new MsItemPattern()
{
// Key of opened model
key = modelKey,
model = new MsModelPattern()
{
transform = new MsFormulaTransformPattern()
{
kind = true,
inputs = ListOperation.Get,
outputs = ListOperation.Get
}
}
}
}
},
tMs = ms
};
// Create a proxy object for operation execution
var somClient = new SomPortTypeClient();
// Open model
var result = somClient.GetMs(getMsOp);
return result.meta.item;
}
See also: