STK ObjectsSend comments on this topic.
IAgMto Interface

Description

Multi-Track Object (MTO) interface.

Public Properties

Public Property AnalysisGet the MTO's spatial state.
Public Property DefaultTrackGet the default MTO track.
Public Property GlobalTrackOptionsGet the global MTO track options.
Public Property GraphicsGet the MTO's 2D Graphics properties.
Public Property TracksGet the collection of MTO tracks.
Public Property VOGet the MTO's 3D Graphics properties.

Interfaces

CoClasses that Implement IAgMto

Name
AgMto

Example

Configure MTO
[C#]
IAgScenario scenario = root.CurrentScenario as IAgScenario;
scenario.SetTimePeriod("1 Feb 2008 12:00:00.000", "2 Feb 2008 12:00:00.000");

// Number of tracks and points to add
double trackCount = 10;
double pointCount = 20;

// Initial values from which we will interpolate
double lat0 = 40.04;
double lon0 = -75.595;
double alt0 = 0;

root.BeginUpdate(); // Call BeginUpdate for STK engine to delay updates

for (int i = 0; i < trackCount; ++i)
{
    IAgMtoTrack track = mto.Tracks.Add(i);
    IAgDate date = root.ConversionUtility.NewDate("UTCG", scenario.StartTime as string);

    // Interpolate mto points
    for (int j = 0; j < pointCount; ++j)
    {
        double lat = lat0 + 1 * i;
        double lon = lon0 + 0.1 * j;
        double alt = alt0;

        date = date.Add("sec", 120);

        track.Points.AddPoint(date.Format("UTCG"), lat, lon, alt);
    }
}

root.EndUpdate();
Create a MTO (on current scenario central body)
[C#]
// Create the MTO
IAgMto mto = root.CurrentScenario.Children.New(AgESTKObjectType.eMTO,  "mto1") as IAgMto;
Configure MTO
[Visual Basic .NET]
Dim scenario As IAgScenario = TryCast(root.CurrentScenario, IAgScenario)
scenario.SetTimePeriod("1 Feb 2008 12:00:00.000", "2 Feb 2008 12:00:00.000")

' Number of tracks and points to add
Dim trackCount As Double = 10
Dim pointCount As Double = 20

' Initial values from which we will interpolate
Dim lat0 As Double = 40.04
Dim lon0 As Double = -75.595
Dim alt0 As Double = 0

root.BeginUpdate()
' Call BeginUpdate for STK engine to delay updates
Dim i As Integer = 0
While i < trackCount
	Dim track As IAgMtoTrack = mto.Tracks.Add(i)
	Dim [date] As IAgDate = root.ConversionUtility.NewDate("UTCG", TryCast(scenario.StartTime, String))

	' Interpolate mto points
	Dim j As Integer = 0
	While j < pointCount
		Dim lat As Double = lat0 + 1 * i
		Dim lon As Double = lon0 + 0.1 * j
		Dim alt As Double = alt0

		[date] = [date].Add("sec", 120)

		track.Points.AddPoint([date].Format("UTCG"), lat, lon, alt)
		System.Threading.Interlocked.Increment(j)
	End While
	System.Threading.Interlocked.Increment(i)
End While

root.EndUpdate()
Create a MTO (on current scenario central body)
[Visual Basic .NET]
' Create the MTO
Dim mto As IAgMto = TryCast(root.CurrentScenario.Children.[New](AgESTKObjectType.eMTO, "mto1"), IAgMto)
Create a New MTO (on the current scenario central body)
[Python - STK API]
# IAgScenario scenario: Scenario object
mto = scenario.Children.New(AgESTKObjectType.eMTO, 'MyMTO')

root.UnitPreferences.SetCurrentUnit('DateFormat', 'EpSec')

mtoTimes = [[0], [7200]]
mtoLats = [[36.77], [34.80]]
mtoLons = [[-77.25], [-78.37]]
mtoAlts = [[5], [5]]

track1 = mto.Tracks.AddTrack(1, mtoTimes, mtoLats, mtoLons, mtoAlts)
track1.Interpolate = True
# Change the color of the track
mto.Graphics.Tracks.GetTrackFromId(1).Color = Colors.Red

Load MTO track points from file
[Python - STK API]
# LoadPoints expects the path an Ephemeris file path
# IAgMto mto: MTO Object
track2 = mto.Tracks.Add(2)
track2.Points.LoadPoints(r'C:\Program Files\AGI\STK 12\Data\Resources\stktraining\text\EphemerisLLATimePosVel_Example.e')
track2.Interpolate = True

Create a New MTO (on the current scenario central body)
[MATLAB]
% IAgScenario scenario: Scenario object
mto = scenario.Children.New('eMTO', 'MyMTO');
root.UnitPreferences.Item('DateFormat').SetCurrentUnit('EpSec');
mtoTimes = {0; 7200};
mtoLats = {36.77; 34.80};
mtoLons = {-77.25; -78.37};
mtoAlts = {5; 5};

track1 = mto.Tracks.AddTrack(1, mtoTimes, mtoLats, mtoLons, mtoAlts);
track1.Interpolate = true;
% Change the color of the track
mto.Graphics.Tracks.GetTrackFromId(1).Color = 255;


        
Load MTO track points from file
[MATLAB]
% LoadPoints expects the path an Ephemeris file path
% IAgMto mto: MTO Object
track2 = mto.Tracks.Add(2);
track2.Points.LoadPoints('C:\Program Files\AGI\STK 12\Data\Resources\stktraining\text\EphemerisLLATimePosVel_Example.e');
track2.Interpolate = true;


        
© 2024 Analytical Graphics, Inc. All Rights Reserved.