ExportForeObjResult ExportForeObj(OdId tObject)
tObject. Unit or assembly moniker.
The ExportForeObj operation exports development environment object to external file.
To execute the operation, in the tObject parameter specify moniker of the repository object that is unit or assembly. The object moniker can be obtained on executing the GetObjects operation. On executing the operation, the development environment object is exported and saved on the server. The operation results in the name of the obtained file and its moniker. The obtained moniker can be further used to import object from file to repository using the ImportForeObj operation.
Below is the example of using the ExportForeObj operation to export repository assembly to external file. The request contains assembly moniker. The response contains name and moniker of the obtained file. The C# example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier example.
{
"ExportForeObj" :
{
"tObject" :
{
"id" : "S1!M!172002"
}
}
}
{
"ExportForeObjResult" :
{
"fileName" : "Additional.ppmodule",
"exportedForeObj" :
{
"id" : "S1!M!Bin!0"
}
}
}
public static ExportForeObjResult ExportInFile(MbId mb, string objId)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tExp = new ExportForeObj()
{
//Create object moniker
tObject = new OdId() { id = mb.id + "!" + FindObjectById(mb, objId).k }
};
//Object export
var result = somClient.ExportForeObj(tExp);
return result;
}
See also: