Description
Represents the automation interface supported by the root object of the Automation Object Model.
Public Methods
Public Properties
Interfaces
CoClasses that Implement IAgStkObjectRoot
Example
Load a VDF
[C#] |
---|
// Pass an empty string if there is no password to the VDF.
root.LoadVDF(vdfPath, vdfPassword);
|
|
Load a VDF
[Visual Basic .NET] |
---|
' Pass an empty string if there is no password to the VDF.
root.LoadVDF(vdfPath, vdfPassword)
|
|
Start STK and get a reference to IAgStkObjectRoot using a running STK instance
[Python] |
---|
# 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] |
---|
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] |
---|
# 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] |
---|
# IAgStkObjectRoot root: STK Object Model Root
root.CloseScenario
|
|
Close STK
[Python] |
---|
# AgUiApplication uiApplication: STK Application
uiApplication.Quit
clear uiApplication root
|
|
Create a new Scenario
[Python] |
---|
# IAgStkObjectRoot root: STK Object Model Root
root.NewScenario('Example_Scenario')
|
|
Set unit preferences for Object Model
[Python] |
---|
# IAgStkObjectRoot root: STK Object Model Root
root.UnitPreferences.Item('DateFormat').SetCurrentUnit('UTCG')
root.UnitPreferences.Item('Distance').SetCurrentUnit('km')
|
|
Execute Connect command
[Python] |
---|
root.ExecuteCommand('New / */Target MyTarget')
|
|
Execute multiple Connect commands
[Python] |
---|
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] |
---|
result = root.ExecuteCommand('Report_RM */Place/MyPlace Style "Cartesian Position"')
for i in range(0,result.Count):
cmdRes = result.Item(i)
print(cmdRes)
|
|
Start STK and get a reference to IAgStkObjectRoot
[MATLAB] |
---|
%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] |
---|
% 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] |
---|
% 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] |
---|
% IAgStkObjectRoot root: STK Object Model Root
root.CloseScenario;
|
|
Close STK
[MATLAB] |
---|
% AgUiApplication uiApplication: STK Application
uiApplication.Quit;
clear uiApplication root
|
|
Get a reference to the AgStkObjectRoot using the running STK instance
[MATLAB] |
---|
% Get reference to running STK instance
uiApplication = actxGetRunningServer('STK11.application');
% Get our IAgStkObjectRoot interface
root = uiApplication.Personality2;
|
|
Create a new Scenario
[MATLAB] |
---|
% IAgStkObjectRoot root: STK Object Model Root
root.NewScenario('Example_Scenario');
|
|
STK window layout settings
[MATLAB] |
---|
% 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] |
---|
% IAgStkObjectRoot root: STK Object Model Root
root.UnitPreferences.Item('DateFormat').SetCurrentUnit('UTCG');
root.UnitPreferences.Item('Distance').SetCurrentUnit('km');
|
|
Execute Connect command
[MATLAB] |
---|
root.ExecuteCommand('New / */Target MyTarget');
|
|
Execute multiple Connect commands
[MATLAB] |
---|
commandList = {'New / */Place MyPlace';'SetPosition */Place/MyPlace Geodetic 37.9 -75.5 0.0'};
root.ExecuteMultipleCommands(commandList,'eExceptionOnError');
|
|
Extract data from Connect result
[MATLAB] |
---|
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
|
|