Below is the example of using the OpenMs operation to create a modeling container. The request contains repository moniker and identifier of the container to be created. The response contains moniker of opened modeling container instance. Any additional data is not obtained.
NOTE. Before creating a modeling container make sure that a default MDM repository is defined for the current repository. To set a default MDM repository, use the property ISpecialObjects.SpecialObject(MetabaseSpecialObject.RdsDatabase).
{
"OpenMs" :
{
"tOb" :
{
"id" : "GEGBFKLHGPMOFOAEIMFEBNKILLAKNJBEIKKFGPFLECLAJIMA!M"
},
"tArg" :
{
"args" :
{
"openNew" :
{
"id" : "MS_NEW",
"name" : "New Model Space"
}
}
}
}
}
{
"OpenMsResult" :
{
"id" :
{
"id" : "GEGBFKLHGPMOFOAEIMFEBNKILLAKNJBEIKKFGPFLECLAJIMA!M!S!CHIPGGCMHGPMOFOAELLCEANGHCHAGCIGEALCDHOJCDACJCCGL"
},
"readOnly" : "0"
}
}
public static OpenMsResult OpenMsNew(MbId mb, string msId, string msName)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
// Set operation execution parameters
var tMsOp = new OpenMs()
{
tArg = new OpenMsArg()
{
// Set container creation parameters
args = new MsOpenArgs()
{
openNew = new MsOpenNew()
{
id = msId,
name = msName,
parent = null
}
}
},
// Create object moniker
tOb = new OdId() { id = mb.id }
};
// Create modeling container
var result = somClient.OpenMs(tMsOp);
return result;
}
See also: