Description
Returns an instance of the STK Object Model
Root Object
Property type
Read-only property
Syntax
| [Visual Basic .NET] |
Public Property StkRootObject() As Object
|
Remarks
Example
The example
demonstrates how to retrieve current scenario's start time via the
STK Object Model.
| Accessing the STK Object Model in a plugin |
Copy Code
|
// IAgStkPluginSite Site;
IAgStkObjectRoot root = Site.StkRootObject as IAgStkObjectRoot;
// Get the scenario object
IAgScenario sc = root.CurrentScenario as IAgScenario;
// Get the scenario's start time
object startTime = sc.StartTime;
|
|
The next example
demonstrates an attempt to close a scenario which is not allowed
via read-only object root. The Object Model handles such situations
by throwing an automation exception warning the user that the
requested operation is prohibited.
| Exception when attempting to execute a prohibited
operation |
Copy Code
|
// IAgStkPluginSite Site;
IAgStkObjectRoot root = Site.StkRootObject as IAgStkObjectRoot;
// Attempts to close a scenario from within a plugin
// will generate an automation exception.
try
{
root.CloseScenario();
}
catch(Exception ex)
{
Site.Message(AgEUtLogMsgType.eUtLogMsgWarning, ex.Message);
}
|
|
See Also