Description
Represents the automation interface supported by the root object of the Automation Object Model.
Object Model
Public Methods
AllInstanceNamesToXML | Returns an XML representation of AllInstanceNames. |
AvailableMarkerTypes | This property is deprecated. Use the AvailableMarkerTypes property from the IAgScVO interface. Retrieves the list of available MarkerTypes |
BeginUpdate | Signals the object that the batch update is starting. |
CloseScenario | Closes the scenario. The method throws an exception if no scenario has been loaded. |
EndUpdate | Signals the object that the batch update is complete. |
ExecuteCommand | Executes a custom CONNECT action. The method throws an exception if the command has failed. |
ExecuteMultipleCommands | Executes multiple CONNECT actions. The behavior of the method when encountering an exception varies depending on the setting of the Action parameter. See the help for AgEExecMultiCmdResultAction. |
GetLicensingReport | Returns a formatted string that contains the license names and their states. The string is formatted as an XML document. |
GetObjectFromPath | Gets the object instance that matches the path provided |
Isolate | Mutually isolates unit preference settings in the current instance from those in other instances of the root. |
Load | Loads a scenario/vdf using the specified path. The method throws an exception if there is a scenario already loaded. |
LoadCustomMarker | Adds a custom marker to Application |
LoadScenario | Use Load method. Loads a scenario using the specified path. The method throws an exception if there is a scenario already loaded. |
LoadVDF | Loads a vdf using the specified path. The method throws an exception if there is a scenario already loaded. If the password isn't needed, enter an empty string. |
NewScenario | Creates a new scenario. User must close a scenario before creating a new one; otherwise an exception will occur. |
ObjectExists | Checks whether a currently loaded scenario contains an object with the given path. |
Save | Saves the changes made to the scenario/vdf. |
SaveAs | Saves the changes made to the scenario/vdf to a specified path and file name. |
SaveScenario | Use Save method. Saves the changes made to the scenario. |
SaveScenarioAs | Use SaveAs method. Saves the changes made to the scenario to a specified path and file name. |
SaveVDFAs | Saves the changes made to the scenario to a specified path and file name as a vdf file. |
Public Properties
AvailableFeatures | Allows the user to inquiry about the available features |
CentralBodies | Returns a collection of available central bodies. |
ConversionUtility | Returns the conversion utility interface. |
CurrentScenario | Returns a Scenario object or null if no scenario has been loaded yet. |
Isolated | Returns whether the instance is isolated. |
NotificationFilter | The event notification filter is used to temporarily disable only the root events to prevent them from being raised. The event filtering can be used to improve client application performance. |
StdMil2525bSymbols | Returns the interface that enables creating 2525b symbols |
StkPreferences | Configures STK preferences. |
UnitPreferences | Provides access to the Global Unit table. |
VgtRoot | Returns an instance of VGT root object. |
Example
Load a VDF
[C#] | Copy Code |
---|
root.LoadVDF(vdfPath, vdfPassword);
|
|
Load a VDF
[Visual Basic .NET] | Copy Code |
---|
root.LoadVDF(vdfPath, vdfPassword)
|
|
Start STK and get a reference to IAgStkObjectRoot
[MATLAB] | Copy Code |
---|
%Create an instance of STK uiApplication = actxserver('STK11.application'); uiApplication.Visible = 1; %Get our IAgStkObjectRoot interface root = uiApplication.Personality2;
|
|
Create instance of AgStkObjectRoot in STK Engine application
[MATLAB] | Copy Code |
---|
% Before instantiating AgStkObjectRoot an instance of AgSTKXApplication or an STK X control must be created % This also requires a STKX license to be present STKXApplication = actxserver('STKX11.application'); rootEngine = actxserver('AgStkObjects11.AgStkObjectRoot');
|
|
Open a VDF
[MATLAB] | Copy Code |
---|
% IAgStkObjectRoot root: STK Object Model Root root.LoadVDF('C:\Program Files\AGI\STK 11\Data\ExampleScenarios\Intro_STK_Space_Systems.vdf','');
|
|
Close an open Scenario
[MATLAB] | Copy Code |
---|
% IAgStkObjectRoot root: STK Object Model Root root.CloseScenario;
|
|
Close STK
[MATLAB] | Copy Code |
---|
% AgUiApplication uiApplication: STK Application uiApplication.Quit; clear uiApplication root
|
|
Get a reference to the AgStkObjectRoot using the running STK instance
[MATLAB] | Copy Code |
---|
% Get reference to running STK instance uiApplication = actxGetRunningServer('STK11.application'); % Get our IAgStkObjectRoot interface root = uiApplication.Personality2;
|
|
Create a new Scenario
[MATLAB] | Copy Code |
---|
% IAgStkObjectRoot root: STK Object Model Root root.NewScenario('Example_Scenario');
|
|
STK window layout settings
[MATLAB] | Copy Code |
---|
% COM.STK11_application uiApplication: STK Application % Loop through the available windows to close the Timeline and maximize the % 3D window timelineWindow = ''; for i=0:uiApplication.Windows.Count - 1 window = uiApplication.Windows.Item(i); if (strcmp(window.Caption,'3D Graphics 1 - Earth')) window.WindowState = 'eWindowStateMaximized'; elseif (strcmp(window.Caption,'')) timelineWindow = window; end end timelineWindow.Close;
|
|
Set unit preferences for Object Model
[MATLAB] | Copy Code |
---|
% IAgStkObjectRoot root: STK Object Model Root root.UnitPreferences.Item('DateFormat').SetCurrentUnit('UTCG'); root.UnitPreferences.Item('Distance').SetCurrentUnit('km');
|
|
Execute Connect command
[MATLAB] | Copy Code |
---|
root.ExecuteCommand('New / */Target MyTarget');
|
|
Execute multiple Connect commands
[MATLAB] | Copy Code |
---|
commandList = {'New / */Place MyPlace';'SetPosition */Place/MyPlace Geodetic 37.9 -75.5 0.0'}; root.ExecuteMultipleCommands(commandList,'eExceptionOnError');
|
|
Extract data from Connect result
[MATLAB] | Copy Code |
---|
result = root.ExecuteCommand('Report_RM */Place/MyPlace Style "Cartesian Position"'); for i = 0:result.Count-1 cmdRes = result.Item(i); fprintf(' %s \n', cmdRes); end
|
|
Start STK and get a reference to IAgStkObjectRoot using a running STK instance
[Python] | Copy Code |
---|
# NOTE: To run these code snippets, see FAQ "Getting Started STK COM integration using Python" at http://agiweb.force.com/faqs # Get reference to running STK instance from win32com.client import GetActiveObject uiApplication = win32com.client.GetActiveObject('STK11.Application') uiApplication.Visible = True # if using the comtypes Library from comtypes.client import GetActiveObject uiApplication=GetActiveObject('STK11.Application') uiApplication.Visible=True # Get our IAgStkObjectRoot interface root = uiApplication.Personality2
|
|
Start STK and get a reference to IAgStkObjectRoot starting a new STK instance
[Python] | Copy Code |
---|
from win32com.client import GetActiveObject uiApplication = win32com.client.Dispatch('STK11.Application') uiApplication.Visible = True # Start new instance of STK from comtypes.client import CreateObject uiApplication = CreateObject('STK11.Application') uiApplication.Visible = True # Get our IAgStkObjectRoot interface root = uiApplication.Personality2
|
|
Open a VDF
[Python] | Copy Code |
---|
# IAgStkObjectRoot root: STK Object Model Root root.LoadVDF(r'C:\Program Files\AGI\STK 11\Data\ExampleScenarios\Intro_STK_Space_Systems.vdf','')
|
|
Close an open Scenario
[Python] | Copy Code |
---|
# IAgStkObjectRoot root: STK Object Model Root root.CloseScenario
|
|
Close STK
[Python] | Copy Code |
---|
# AgUiApplication uiApplication: STK Application uiApplication.Quit clear uiApplication root
|
|
Create a new Scenario
[Python] | Copy Code |
---|
# IAgStkObjectRoot root: STK Object Model Root root.NewScenario('Example_Scenario')
|
|
Set unit preferences for Object Model
[Python] | Copy Code |
---|
# IAgStkObjectRoot root: STK Object Model Root root.UnitPreferences.Item('DateFormat').SetCurrentUnit('UTCG') root.UnitPreferences.Item('Distance').SetCurrentUnit('km')
|
|
Execute Connect command
[Python] | Copy Code |
---|
root.ExecuteCommand('New / */Target MyTarget')
|
|
Execute multiple Connect commands
[Python] | Copy Code |
---|
commandList = [ ['New / */Place MyPlace'],['SetPosition */Place/MyPlace Geodetic 37.9 -75.5 0.0'] ] root.ExecuteMultipleCommands(commandList,2) # eExceptionOnError
|
|
Extract data from Connect result
[Python] | Copy Code |
---|
result = root.ExecuteCommand('Report_RM */Place/MyPlace Style "Cartesian Position"') for i in range(0,result.Count): cmdRes = result.Item(i) print(cmdRes)
|
|
CoClasses that Implement IAgStkObjectRoot