Below is the example of using the OpenMs operation to open a modeling container for edit. The request contains the container moniker and whether the container must be opened for edit. The response contains moniker of opened modeling container instance. Any additional data is not obtained.
The C# example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier section.
{
"OpenMs" :
{
"tOb" :
{
"id" : "GEGBFKLHGPMOFOAEIMFEBNKILLAKNJBEIKKFGPFLECLAJIMA!M!306480"
},
"tArg" :
{
"args" :
{
"openForEdit" : "true"
}
}
}
}
{
"OpenMsResult" :
{
"id" :
{
"id" : "GEGBFKLHGPMOFOAEIMFEBNKILLAKNJBEIKKFGPFLECLAJIMA!M!S!CEDFMNBMHGPMOFOAEEOKCHDKLPKPFFKNEILBKMMPKNGGGFEEE"
},
"readOnly" : "0"
}
}
public static MsId OpenMsEdit(MbId mb, string msId)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
// Set operation execution parameters
var tMsOp = new OpenMs()
{
tArg = new OpenMsArg()
{
// Set container opening parameters
args = new MsOpenArgs()
{
openForEdit = true
}
},
// Create object moniker
tOb = new OdId() { id = mb.id + "!" + FindObjectById(mb, msId).k }
};
// Open modeling container for edit
var result = somClient.OpenMs(tMsOp);
return result.id;
}
See also: