AGI STK Objects 11 Send comments on this topic.
IAgMto Interface





Description

Multi-Track Object (MTO) interface.

Object Model







Public Properties

Public Property Analysis Get the MTO's spatial state.
Public Property DefaultTrack Get the default MTO track.
Public Property GlobalTrackOptions Get the global MTO track options.
Public Property Graphics Get the MTO's 2D Graphics properties.
Public Property Tracks Get the collection of MTO tracks.
Public Property VO Get the MTO's 3D Graphics properties.

Example

Configure MTO
[C#] Copy Code
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#] Copy Code
// Create the MTO 
IAgMto mto = root.CurrentScenario.Children.New(AgESTKObjectType.eMTO,  "mto1"as IAgMto; 
 

Configure MTO
[Visual Basic .NET] Copy Code
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 <>
    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 <>
        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] Copy Code
' 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)
[MATLAB] Copy Code
% IAgScenario scenario: Scenario object 
mto = scenario.Children.New('eMTO','MyMTO'); 
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] Copy Code
% 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 11\Help\stktraining\text\EphemerisLLATimePosVel_Example.e'); 
track2.Interpolate = true; 
 
 

CoClasses that Implement IAgMto

Name
AgMto
© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1