GetModuleResult GetModule(OdId tObject)
tObject. Unit moniker.
The GetModule operation gets information about repository Fore unit.
To execute the operation, in the tObject parameter specify moniker of the repository object that is unit. The object moniker can be obtained on executing the GetObjects operation. The operation results in the code implemented in the unit, and a list of links to the assemblies connected to the unit.
Bellow is the example of using the GetModule operation to get information about the unit. The request contains moniker of unit in the repository. The response contains unit text, the list of connected assemblies and also description of the unit as a repository object. The example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier example.
{
"GetModule" :
{
"tObject" :
{
"id" : "S1!M!172002"
}
}
}
{
"GetModuleResult" :
{
"meta" :
{
"text" : "Public Class TestObject: Object \t_arr: Array Of Double; \tPublic Constructor Create; \tBegin \t\t_arr := New Double[5]; \tEnd Constructor Create; \tPublic Constructor CreateWithParams(Size: Integer; DefaultValue: Double = 0); \tBegin \t\t_arr := New Double[Size]; \t\tIf DefaultValue <> 0 Then \t\t\t\/\/... \t\tEnd If; \tEnd Constructor CreateWithParams; \tPublic Sub Run; \tBegin \t\t\/\/... \tEnd Sub Run; End Class TestObject; Sub Main; Var \tobj: TestObject; Begin \tobj := New TestObject.CreateWithParams(10, 100); \tDebug.WriteLine("The main procedure is running. The object is created."); \t\/\/... End Sub Main;",
"references" :
{
"builtinReferences" :
{
"s" :
[
"Collections",
"Cubes",
"Metabase"
]
},
"repoReferences" : ""
},
"desc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "18",
"@hf" : "0",
"i" : "M_ADDITIONAL",
"n" : "Additional",
"k" : "172002",
"c" : "1537",
"p" : "171999",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0"
}
}
}
}
public static GetModuleResult GetModuleInfo(MbId mb, string modId)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tGet = new GetModule()
{
//Create object moniker
tObject = new OdId() { id = mb.id + "!" + FindObjectById(mb, modId).k }
};
//Get unit information
var result = somClient.GetModule(tGet);
return result;
}
See also: