AGI STK Objects 11 Send comments on this topic.
AddTrack Method (IAgMtoTrackCollection)
See Also  Example
TrackId
The TrackID must be larger than all other TrackIDs existing for the MTO.
TimeVals
LatVals
LonVals
AltVals





Description

Adds a new track with the specified point data.

Syntax

[Visual Basic .NET]
Public Function AddTrack( _
   ByVal TrackId As Integer, _
   ByRef TimeVals As System.Array, _
   ByRef LatVals As System.Array, _
   ByRef LonVals As System.Array, _
   ByRef AltVals As System.Array _
) As IAgMtoTrack

[C#]
public IAgMtoTrack AddTrack(
int TrackId,
ref System.Array TimeVals,
ref System.Array LatVals,
ref System.Array LonVals,
ref System.Array AltVals
);

[Managed C++]
public: IAgMtoTrack^ AddTrack(
int TrackId,
System::Array ^^ TimeVals,
System::Array ^^ LatVals,
System::Array ^^ LonVals,
System::Array ^^ AltVals
);

[Java]
public IAgMtoTrack addTrack(
int TrackId,
Object[] TimeVals,
Object[] LatVals,
Object[] LonVals,
Object[] AltVals
);

[Unmanaged C++]
public: HRESULT AddTrack(
long TrackId,
SAFEARRAY ** TimeVals,
SAFEARRAY ** LatVals,
SAFEARRAY ** LonVals,
SAFEARRAY ** AltVals,
IAgMtoTrack ** ReturnValue
);

Parameters

TrackId
The TrackID must be larger than all other TrackIDs existing for the MTO.
TimeVals
LatVals
LonVals
AltVals

Example

Add MTO track
[C#] Copy Code
IAgMtoTrackCollection trackCollection = mto.Tracks; 
 
Array time = new object[] 
             { 
                 "1 Jan 2012 12:10:00.000""1 Jan 2012 12:20:00.000" 
             }; 
Array latitude = new object[] 
                 { 
                     27.97, -26.51 
                 }; 
Array longitude = new object[] 
                  { 
                      -80.01119.42 
                  }; 
Array altitude = new object[] 
                 { 
                     20.144.2 
                 }; 
 
// AddTrack expects each safe array parameter to be two dimensional, 
// all arrays must have the same length 
IAgMtoTrack track = trackCollection.AddTrack(1ref time, ref latitude, ref longitude, ref altitude); 
 

Load MTO track points from file
[C#] Copy Code
// LoadPoints expects the path an Ephemeris file path 
track.Points.LoadPoints(filePath); 
 

Add MTO track
[Visual Basic .NET] Copy Code
Dim trackCollection As IAgMtoTrackCollection = mto.Tracks

#If Not CSToJava Then
#Else
#End If
Dim time As Array = New Object() {"1 Jan 2012 12:10:00.000", "1 Jan 2012 12:20:00.000"}
#If Not CSToJava Then
#Else
#End If
Dim latitude As Array = New Object() {27.97, -26.51}
#If Not CSToJava Then
#Else
#End If
Dim longitude As Array = New Object() {-80.01, 119.42}
#If Not CSToJava Then
#Else
#End If
Dim altitude As Array = New Object() {20.1, 44.2}

' AddTrack expects each safe array parameter to be two dimensional,
' all arrays must have the same length
#If Not CSToJava Then
Dim track As IAgMtoTrack = trackCollection.AddTrack(1, time, latitude, longitude, altitude)
#Else
#End If

Load MTO track points from file
[Visual Basic .NET] Copy Code
' LoadPoints expects the path an Ephemeris file path
track.Points.LoadPoints(filePath)

See Also

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1