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
|
| [C#] |
|---|
public Object StkRootObject {get;}
|
| [Managed C++] |
|---|
public: __property IUnknown ^ get_StkRootObject();
|
| [Unmanaged C++] |
|---|
public: HRESULT get_StkRootObject(
IUnknown ** ppRetVal
);
|
| [Java] |
|---|
public Object getStkRootObject();
|
Remarks
See Also
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 |
|---|
// 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 |
|---|
// 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); } |
|
The example demonstrates how to retrieve current scenario's start time via the STK Object Model.
| Accessing the STK Object Model in a plugin |
|---|
// 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 |
|---|
// 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); } |
|