<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Code Exchange: AGI Developer Network.</title>
    <link>http://adn.agi.com/CodeExchange/</link>
    <description>Code Exchange</description>
    <item>
      <title>Code Exchange</title>
      <link>http://adn.agi.com/CodeExchange/</link>
      <description>Check out all Code Exchange resources from the AGI Developer Network.</description>
    </item>
    <item>
      <title>AGI Components in Matlab - simple access example</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=&amp;campaignId=310&amp;page=/codeExchange</link>
      <description>% simple access example using AGI Components in Matlab. There is a bug with loading .net dlls in Matlab 2009a so use 2009b for this example&#xD;
&#xD;
% add dlls &#xD;
NET.addAssembly('C:\Program Files\AGI\AGI Components 2009\r1\Assemblies\AGI.Foundation.Communications.dll');&#xD;
NET.addAssembly('C:\Program Files\AGI\AGI Components 2009\r1\Assemblies\AGI.Foundation.Core.dll');&#xD;
NET.addAssembly('C:\Program Files\AGI\AGI Components 2009\r1\Assemblies\AGI.Foundation.Models.dll');&#xD;
NET.addAssembly('C:\Program Files\AGI\AGI Components 2009\r1\Assemblies\AGI.Foundation.Navigation.dll');&#xD;
NET.addAssembly('C:\Program Files\AGI\AGI Components 2009\r1\Assemblies\AGI.Foundation.Platforms.dll');&#xD;
NET.addAssembly('C:\Program Files\AGI\AGI Components 2009\r1\Assemblies\AGI.Foundation.Spatial.dll');&#xD;
NET.addAssembly('C:\Program Files\AGI\AGI Components 2009\r1\Assemblies\AGI.Foundation.Terrain.dll');&#xD;
NET.addAssembly('C:\Program Files\AGI\AGI Components 2009\r1\Assemblies\AGI.Foundation.TimeStandards.dll');&#xD;
&#xD;
% define, position, and orient platforms&#xD;
platform1 = AGI.Foundation.Platforms.Platform;&#xD;
platform2 = AGI.Foundation.Platforms.Platform;&#xD;
&#xD;
earth = AGI.Foundation.Celestial.CentralBodiesFacet.GetFromContext().Earth;&#xD;
locationPoint1 = AGI.Foundation.Geometry.PointCartographic(earth, AGI.Foundation.Coordinates.Cartographic(0, 0, 1000000));&#xD;
locationPoint2 = AGI.Foundation.Geometry.PointCartographic(earth, AGI.Foundation.Coordinates.Cartographic(0.1, 0.1, 1000000));&#xD;
&#xD;
orientationAxes1 = AGI.Foundation.Geometry.Axes.Root;&#xD;
orientationAxes2 = AGI.Foundation.Geometry.Axes.Root;&#xD;
&#xD;
platform1.LocationPoint = locationPoint1;&#xD;
platform2.LocationPoint = locationPoint2;&#xD;
platform1.OrientationAxes = orientationAxes1;&#xD;
platform2.OrientationAxes = orientationAxes2;&#xD;
&#xD;
% set up access&#xD;
access = AGI.Foundation.Access.AccessComputation;&#xD;
access.Transmitter = platform1;&#xD;
access.Receiver = platform2;&#xD;
&#xD;
earth.OrientationParameters = AGI.Foundation.Celestial.EarthOrientationParametersFile.ReadData('C:\Program Files\AGI\STK 8\DynamicEarthData\EOP-v1.1.txt');&#xD;
&#xD;
lineOfSight = AGI.Foundation.Access.Constraints.CentralBodyObstructionConstraint;&#xD;
access.TransmitterConstraints.Add(lineOfSight);&#xD;
&#xD;
accessTimeJD = AGI.Foundation.Time.JulianDate(2454971);     % not sure how to get DateTime in Matlab&#xD;
oneTimeAccess = access.GetEvaluator();&#xD;
accessState = oneTimeAccess.Evaluate(accessTimeJD)</description>
    </item>
    <item>
      <title>Where's IS for STK9</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=CSharp_WhereIsISS_STK9.zip&amp;campaignId=311&amp;page=/codeExchange</link>
      <description>Updated version of the Where's ISS for STK9</description>
    </item>
    <item>
      <title>AGI Components in Matlab</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=AGIComponentsInMatlab.zip&amp;campaignId=313&amp;page=/codeExchange</link>
      <description>This zip file contains Matlab files that show how to use AGI Components, version 2009 R4 or later with Matlab version 2009a or later.</description>
    </item>
    <item>
      <title>Insight3D Wrapper for Matlab</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=I3DDialogLibrary.zip&amp;campaignId=315&amp;page=/codeExchange</link>
      <description>This VS 2008 project provides a way to use Insight3D within Matlab.  The project builds a dll file.  The dll can be called from Matlab, using their new .Net support, to interact with the Insight3D globe.</description>
    </item>
    <item>
      <title>Sample Ui Plugin: Calculator source code</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=UiPlugin_Calc_104_source.zip&amp;campaignId=316&amp;page=/codeExchange</link>
      <description>This is a small sample source code for Microsoft Visual Studio 2005, demonstrating a very simple UI Plugin for STK 9, which adds a toolbar button that the user may click to spawn a calculator.  The calculator fits in a proper STK tool window, which may be integrated, docked, and floated, just like other native STK windows.&#xD;
&#xD;
Users are encouraged to examine this source code, to learn how to integrate their own custom tools as STK 9 UI Plugins.</description>
    </item>
    <item>
      <title>STK/Coverage FOM to ArcGIS UI Plugin</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=Cov2GRID.zip&amp;campaignId=342&amp;page=/codeExchange</link>
      <description>UI Plugin which converts a computed STK/Coverage Figure of Merit (FOM) into a point Feature Class and GRID (.adf) files.  Connects to running instance of ArcGIS.  Allows STK FOM data to be leveraged by specialized tools inside ESRI ArcGIS.</description>
    </item>
    <item>
      <title>data providers via VBA</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=&amp;campaignId=347&amp;page=/codeExchange</link>
      <description>Dim sat As IAgStkObject
Set sat = Root.GetObjectFromPath("*/Satellite/Sat")
   
Dim cartPos As IAgDataProviderGroup
Set cartPos = sat.DataProviders.Item("Cartesian Position")
   
Dim cartPosJ2000 As IAgDataProvider
Set cartPosJ2000 = cartPos.Group("J2000")
   
Dim posResults As IAgDrResult
Dim posTimeVariable As IAgDataPrvTimeVar
   
Set posTimeVariable = cartPosJ2000
   
Dim posElements(2) As Variant
posElements(0) = "x"
posElements(1) = "y"
posElements(2) = "z"
   
Set posResults = posTimeVariable.ExecElements("1 Jul 2009 00:00:00.000", "2 Jul 2009 00:00:00.000", 60, posElements)
   
Dim data As IAgDrDataSet
Set data = posResults.DataSets.GetDataSetByName("x")
   
Dim values As Variant
values = data.GetValues()
   
For Each Value In values
   MsgBox (CStr(Value))
Next</description>
    </item>
    <item>
      <title>AMM Connect Example</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=AMM_Connect.zip&amp;campaignId=348&amp;page=/codeExchange</link>
      <description>Define an aircraft route using AMM procedures, then compute access to a point target.</description>
    </item>
    <item>
      <title>AMM Connect Example</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=AMM_Connect1.zip&amp;campaignId=349&amp;page=/codeExchange</link>
      <description>Define an aircraft route using AMM procedures, then compute access to a point target.</description>
    </item>
    <item>
      <title>export .a file with YPR or Euler angles</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=post processing2.zip&amp;campaignId=351&amp;page=/codeExchange</link>
      <description>the regular export tool only allows you to generate attitude files using quaternions. These post-processing scripts let you to generate .a files in YPR or Euler angle format</description>
    </item>
    <item>
      <title>when is satellite ascending or descending</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=&amp;campaignId=352&amp;page=/codeExchange</link>
      <description>EarthCentralBody earth = CentralBodiesFacet.GetFromContext().Earth;

// satellite platform
Platform iss = new Platform("ISS");
TwoLineElementSet tle = new TwoLineElementSet("1 25544U 98067A   09274.15188778  .00012894  00000-0  90693-4 0  7046\n2 25544  51.6388 122.7965 0008624 148.3536 308.1179 15.74510192622649");
Sgp4Propagator propagator = new Sgp4Propagator(tle);
iss.LocationPoint = propagator.CreatePoint();
iss.OrientationAxes = Axes.Root;

// some dummy facility that I can compute access to
Platform dummy = new Platform();
dummy.LocationPoint = new PointCartographic(earth, new Cartographic(0.0, 0.0, 0.0));
dummy.OrientationAxes = Axes.Root;


// create velocity vector
Vector vVector = new VectorVelocity(iss.LocationPoint, earth.FixedFrame);

// create [0, 0, -1] vector in Earth fixed
Vector negZ = new VectorFixed(earth.FixedFrame.Axes, new Cartesian(0.0, 0.0, -1.0));

// compute angle between velocity vector and negative Z
ScalarAngleBetweenVectors angle = new ScalarAngleBetweenVectors(vVector, negZ);

// if the angle is 0 - 90 degree then the satellite is heading south, otherwide heading north
ScalarConstraint ascending = new ScalarConstraint(angle, Trig.DegreesToRadians(90.0));


// Access
AccessComputation access = new AccessComputation();
access.Transmitter = iss;
access.TransmitterConstraints.Add(ascending);
access.Receiver = dummy;

JulianDate jdNow = new JulianDate(DateTime.Now);
JulianDate jdEnd = jdNow.AddDays(1);

AccessEvaluationResult accessResult = access.ComputeIntervals(jdNow, jdEnd);
TimeIntervalCollection intervals = accessResult.OverallSatisfactionIntervals;

foreach (TimeInterval thisInterval in intervals)
{
	DateTime thisStart = thisInterval.Start.ToDateTime();
	DateTime thisStop = thisInterval.Stop.ToDateTime();
}

// use a similar logic to get the descending times</description>
    </item>
    <item>
      <title>Data Provider with VBSCRIPT</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=ObjectModelDataProviderExampleVBSCRIPT.zip&amp;campaignId=353&amp;page=/codeExchange</link>
      <description>This is an example of using the STK Object Model to extract data from a Data Provider inside of an HTML interface using VBScript</description>
    </item>
    <item>
      <title>Excel Ephemeris Creator with VBA</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=EphemerisCreator.zip&amp;campaignId=354&amp;page=/codeExchange</link>
      <description>This is an excel sheet with some embedded buttons using Connect to create an ephemeris file based on columns of LAT/LON/ALT/TIME</description>
    </item>
    <item>
      <title>Excel Attitude Creator with VBA</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=AttitudeCreator.zip&amp;campaignId=355&amp;page=/codeExchange</link>
      <description>This is an excel sheet with some embedded buttons using Connect to create an Attitude file based on columns of YAW/PITCH/ROLL/TIME</description>
    </item>
    <item>
      <title>ITU SRS (Space Radiocommunications Stations) Database Utility</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=SRSDatabaseUtility.zip&amp;campaignId=356&amp;page=/codeExchange</link>
      <description>The SRS Database utility will allow a user to point to a local SRS database and populate their STK Scenario with available Satellites and corresponding transmitters.</description>
    </item>
    <item>
      <title>AMM Connect Example 2</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=AMMConnect2.zip&amp;campaignId=358&amp;page=/codeExchange</link>
      <description>After starting the script, you should get a few popup windows that tell you certain characteristics about the Aircraft1, followed by some reports that are generated.  If you watch the 3d window, you’ll notice that the length of the racetrack is changing for each iteration</description>
    </item>
    <item>
      <title>Boresight Earth Intersection Tool</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=Load_BoresightIntersection_GroundVehicle.zip&amp;campaignId=359&amp;page=/codeExchange</link>
      <description>This script creates a GroundVehicle to follow the intersection of a sensor boresight with the central body.

This is useful for evaluating properties (like lighting constraints) of the Earth Intersection point.</description>
    </item>
    <item>
      <title>Count Number of Satellites in Scenario</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=GetNumberSats.zip&amp;campaignId=360&amp;page=/codeExchange</link>
      <description>Uses the ShowNames connect command to list the satellites in the current scenario, and uses vbscript to count the number of lines</description>
    </item>
    <item>
      <title>astrogator connect example - Matlab</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=LunarMissionConnect.zip&amp;campaignId=362&amp;page=/codeExchange</link>
      <description>the Matlab script builds a simple lunar mission from Matlab via connect commands. The .zip file includes 3 different versions of the script depending on which version of STK you are using. A version of this should work for STKv4 - STKv9</description>
    </item>
    <item>
      <title>terrain converter</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=TerrainConverter.zip&amp;campaignId=363&amp;page=/codeExchange</link>
      <description>this utility converts terrain data to .pdtt files&#xD;
&#xD;
the attached .zip file inclides the whole VS2005 project as well as the executable. Either run the executable or build the project yourself</description>
    </item>
    <item>
      <title>draw sensor in Insight3D</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=ModelVectorOrientationCodeSnippet1.zip&amp;campaignId=364&amp;page=/codeExchange</link>
      <description>see https://adn.agi.com/forum/viewmessages.cfm?forum=20&amp;topic=476</description>
    </item>
    <item>
      <title>Connecting to STK9 from MATLAB, Object Model</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=AutomateSTK_ObjectModel.zip&amp;campaignId=365&amp;page=/codeExchange</link>
      <description>This script demonstrates how to launch and control STK9 from Matlab.  Script will create a simple scenario and pull access data providers for reporting.

Originally created by Jonathan Lowe, updated by Daniel Honaker 11/1/2009.</description>
    </item>
    <item>
      <title>HTML SatTracker Updated</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=htm_STKX_SatTracker.zip&amp;campaignId=366&amp;page=/codeExchange</link>
      <description>This is an updated version of the HTML Satellite Tracker.  This is a stand alone HTML page with embedded STK Engine controls and a 2D window control.  This will work with STK 9 and the previous version of this didnt handle time zones correctly, see below for details:&#xD;
&#xD;
I had to add a quick error check to determine if the GMT offset was a negative hour or a positive hour.  If it was negative AND had an extra half hour offset (i.e. -8.5 hours) it now will handle that correctly where the old version would have simply added the half hour to the already negative offset making it an hour off (i.e. -8+.5= -7.5 versus -8-.5= -8.5).&#xD;
&#xD;
Also changed the directory where the Satellite database files were located as this changed from STK 8 to STK 9.</description>
    </item>
    <item>
      <title>calculate lunar phase</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=LunarPhase.zip&amp;campaignId=369&amp;page=/codeExchange</link>
      <description>simple AGI Components project that determines the Earth-Moon-Sun angle and derives the lunar phase from that. Also comes with a pretty website that displays the phase</description>
    </item>
    <item>
      <title>C# TCP/IP Socket Connection Port 5001</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=Csharp_SocketConnect.zip&amp;campaignId=370&amp;page=/codeExchange</link>
      <description>This application allows the user to send connect commands to STK via the TCP/IP Socket Connection in C#.</description>
    </item>
    <item>
      <title>MATLAB and ODTK</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=ODTKquantities4.zip&amp;campaignId=371&amp;page=/codeExchange</link>
      <description>This sample script shows several operations in ODTK from MATLAB:&#xD;
&#xD;
Edit Measurement List&#xD;
Edit Maneuver List&#xD;
Edit Smoother Predict Date&#xD;
Create a NewDate Object&#xD;
Create new Distance quantity&#xD;
Edit Satellite Orbit State&#xD;
Generate new product&#xD;
Export from Product Builder</description>
    </item>
    <item>
      <title>gpx2stk</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=gpx2stk.zip&amp;campaignId=372&amp;page=/codeExchange</link>
      <description>This utilty will create STK ephemeris files from tracks defined within GPX (GPS Exchange Format) files. Track points not in time ascending order are ignored.

A compiled executable is available upon request (support@agi.com)</description>
    </item>
    <item>
      <title>orbit wizard classes</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=OrbitWizard1.zip&amp;campaignId=378&amp;page=/codeExchange</link>
      <description>these classes provide a similar capability  to STK Engine as the orbit wizard provides though the GUI and easily let you create&#xD;
- circular orbits&#xD;
- geosynchronous orbits&#xD;
- molniya orbits&#xD;
- repeating ground track orbits&#xD;
- Sun synchronous orbits&#xD;
- repeating Sun synchronous orbits</description>
    </item>
    <item>
      <title>EADSIM to STK antenna pattern file</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=Utility_EADSIM_To_STKAntenna.zip&amp;campaignId=379&amp;page=/codeExchange</link>
      <description>This utility will convert EADSIM files into antenna pattern files to be used with transmitters and receivers in STK.</description>
    </item>
    <item>
      <title>Earth Intersection Points as STK Objects</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=EarthIntersectionPoints_as_STKObjects.zip&amp;campaignId=380&amp;page=/codeExchange</link>
      <description>These are a couple simple HTML utilities to use Earth Intersection Points (either from a Nadir Vector or Sensor Boresight) to create STK Objects (ground vehicles or line targets).</description>
    </item>
    <item>
      <title>Java Sensor Projection Data Providers</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=&amp;campaignId=381&amp;page=/codeExchange</link>
      <description>//Get the current scenario properties

 

IAgStkObject scenObject = new AgStkObject(this.m_IAgScenario);

 

//Get the current satellite to attach a sensor to

 

IAgStkObjectCollection scenObjects = scenObject.getChildren();

AgVariant varSat = new AgVariant(s_SAT_NAME);

IAgStkObject objSat = scenObjects.getItem(varSat);

 

//Attach a new sensor object to the satellite

 

IAgStkObject mySensorObject = objSat.getChildren()._new(AgESTKObjectType.eSensor, s_SENSOR_NAME);

IAgSensor mySensor = new AgSensor(mySensorObject);

 

 

//Define the sensor pattern

 

mySensor.setPatternType(AgESnPattern.eSnRectangular);       

IAgSnPattern myPattern = mySensor.getPattern();       

IAgSnRectangularPattern rectSensor = new AgSnRectangularPattern(myPattern);

rectSensor.setVerticalHalfAngle(new AgVariant(this.horz_angle));

rectSensor.setHorizontalHalfAngle(new AgVariant(this.vert_angle));

 

//Define the sensor pointing type

 

mySensor.setPointingType(AgESnPointing.eSnPtFixed);   

IAgSnPointing myPointing = mySensor.getPointing();

IAgSnPtFixed myFixed = new AgSnPtFixed(myPointing);

myFixed.getOrientation().assignAzEl(new AgVariant(this.az),new AgVariant(this.el), boresight);

 

//Set the graphics of the sensor

 

IAgSnGraphics sensGraphics = mySensor.getGraphics();

 

//Set the 3d properties of the sensor

 

IAgSnVO sensVO = mySensor.getVO();

sensVO.setInheritFrom2D(1);

sensGraphics.setColor(255); //red

 

//set the projection of the sensor

 

IAgSnProjection myproj = sensGraphics.getProjection();

 

myproj.setUseDistance(true);

myproj.setDistanceType(AgESnProjectionDistanceType.eConstantAlt);

 

myproj.setForwardPersistence(true);

myproj.setPersistence(persist);

 

 

String SensorAltitude = textfield.getText();

 

Double SensorAltitudeDouble = Double.parseDouble(SensorAltitude);

 

IAgDisplayDistance dist = myproj.getDistanceData();

IAgSnProjDisplayDistance mydist = new AgSnProjDisplayDistance(dist);

mydist.setMax(SensorAltitudeDouble);

mydist.setMin(0);

mydist.setNumberOfSteps(1);

mydist.setProjectsThruCrossing(false);</description>
    </item>
    <item>
      <title>access duration per day</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=AccessDurationPerDay.zip&amp;campaignId=384&amp;page=/codeExchange</link>
      <description>this  post-processing script returns the access duration per day</description>
    </item>
    <item>
      <title>Create AMM aircraft from waypoints file</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=&amp;campaignId=385&amp;page=/codeExchange</link>
      <description>This code will automatically read in a file of waypoints and create an AMM aircraft.

Procedure:

1)  Create a waypoints.txt file in your c drive (C:\waypoints.txt)

Example format is below (lat ##.### lon ##.###):

33.916  70.391
34.519	69.985
34.599	69.689
34.571	69.416
34.234	69.112
34.431	69.191
34.520	69.156
34.878	69.238
34.804	69.151
34.720	69.103
34.448	68.747
33.957	69.052
34.048	68.744

2)  Start STK 9 and load a scenario (Make sure there are no objects called Aircraft1).

3)  Create a .vbs file (i.e. AMMwaypoints.vbs) in a text editor from the code snippet below and run the script.

'Open a file for reading and writing the files
Dim objOutFile
Dim oTF,oFSO
Dim filename
Dim strNextLine
Dim Latitude_deg, Longitude_deg, count
Set oFSO = CreateObject("Scripting.FileSystemObject")

Dim app
Set app = GetObject(,"STK9.Application")
set stk = app.Personality2


Set objFile = oFSO.OpenTextFile("C:\waypoints.txt")
count = 1

msgbox("Loading waypoints file from C:\waypoints.txt")

       
Do Until objFile.AtEndOfStream
    strNextLine = objFile.Readline
    If count &gt;= 0 Then
        
       	Latitude_deg = CDbl(Trim(Left(strNextLine,6))) 
       	Longitude_deg = CDbl(Trim(Mid(strNextLine,8,6)))
        
       	If count = 1 Then
       
       	stk.ExecuteCommand("New / */Aircraft Aircraft1")
       	stk.ExecuteCommand("SetPropagator */Aircraft/Aircraft1 MissionModeler")
       	stk.ExecuteCommand("MissionModeler */Aircraft/Aircraft1 Aircraft Copy ""Basic UAV""")
       	stk.ExecuteCommand("MissionModeler */Aircraft/Aircraft1 Aircraft Choose ""Copy of Basic UAV""")
       	
       	'Defining the first waypoint	
       	
       	stk.ExecuteCommand("MissionModeler */Aircraft/Aircraft1 Procedure Add AsFirst SiteType Waypoint ProcedureType ""Enroute""")
       	stk.ExecuteCommand("MissionModeler */Aircraft/Aircraft1 Site 1 SetValue Latitude " + CStr(Latitude_deg) + " deg")
       	stk.ExecuteCommand("MissionModeler */Aircraft/Aircraft1 Site 1 SetValue Longitude " + CStr(Longitude_deg) + " deg")
       
       	End If
     
        
    End If
    	
    	'Add a new waypoint after the previous waypoint
    	
    	stk.ExecuteCommand("MissionModeler */Aircraft/Aircraft1 Procedure Add After " + CStr(count) + " SiteType Waypoint ProcedureType ""Enroute""")
    	
    	'Loop onto the next waypoint
    	
    	count = count + 1
    	
    	'Set the new value of the waypoint
    
     	stk.ExecuteCommand("MissionModeler */Aircraft/Aircraft1 Site " + CStr(count) + " SetValue Latitude " + CStr(Latitude_deg) + " deg")
    	stk.ExecuteCommand("MissionModeler */Aircraft/Aircraft1 Site " + CStr(count) + " SetValue Longitude " + CStr(Longitude_deg) + " deg")
   	
Loop

msgbox("Finished Creating Aircraft")</description>
    </item>
    <item>
      <title>Midcourse Intercept HTML Script</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=MidcourseInterceptionTool.zip&amp;campaignId=387&amp;page=/codeExchange</link>
      <description>This is a simple mathematical script that automates the creation of STK missile objects that intercept a target object.

This script uses standard connect commands to automate the STK desktop application.</description>
    </item>
    <item>
      <title>Matlab Realtime Example</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=MATLAB_Realtime1.zip&amp;campaignId=388&amp;page=/codeExchange</link>
      <description>This is a Matlab script that simulates sending "Real Time" data to an STK Satellite object.  It will send position and attitude data at a set time interval.</description>
    </item>
    <item>
      <title>Area Target Importer For Custom Application Framework 9</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=AreaTargetImporter.zip&amp;campaignId=389&amp;page=/codeExchange</link>
      <description>Similar to the Area Target importing capability in STK 9, this project creates an "Addin" for the Custom Application Framework (CAF) 9 which replicates that capability.  Allowing users to sort by State, Country or AOR, Area Targets of interest can quickly be imported into your scenario using the CAF.</description>
    </item>
    <item>
      <title>Example for Attitude Integration</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=ExampleAttitudeIntegration.zip&amp;campaignId=390&amp;page=/codeExchange</link>
      <description>Example scenario and plugin registration XML for the Attitude Integration sample on the Astrogator Blog</description>
    </item>
    <item>
      <title>MATLAB Data Provider Examples</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=DP_Examples.zip&amp;campaignId=392&amp;page=/codeExchange</link>
      <description>Here is an example of how to use most of the data provider types in MATLAB.</description>
    </item>
    <item>
      <title>Real Time Aircraft Control</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=RealTimeACcontrol1.zip&amp;campaignId=396&amp;page=/codeExchange</link>
      <description>This application allows you to control an aircraft in Real Time.</description>
    </item>
    <item>
      <title>Satellite Lifetime Tool from MATLAB</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=LifetimeTool.zip&amp;campaignId=399&amp;page=/codeExchange</link>
      <description>This MATLAB COM script will setup a simple satellie scenario and calculate how long before the satellite's orbit will decay using the Lifetime Tool.  The data will be returned and parsed in MATLAB.</description>
    </item>
    <item>
      <title>SPICE Sat Reload Plugin</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=satReloadPlugin.zip&amp;campaignId=400&amp;page=/codeExchange</link>
      <description>This UIPlugin adds a Satellite Menu option to simply reload a SPICE propagated satellite.</description>
    </item>
    <item>
      <title>Vector Plugin to constrain sensor pointing behavior</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=GimbleLimits.zip&amp;campaignId=401&amp;page=/codeExchange</link>
      <description>The HTML user interface allows the user to apply physical max and min elevation angle constraints on a gimballing sensor trying to target an object by automatically writing a Vector Geometry Tool (VGT) plugin to constrain the sensor's behavior.</description>
    </item>
    <item>
      <title>Radar Detection HTML and Scenario</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=RadarDetection.zip&amp;campaignId=402&amp;page=/codeExchange</link>
      <description>This Demo Scenario uses installed STK imagery and terrain to show how STK Radar analysis can be automated or integrated into other operational systems. 

The ReadMe.doc outlines the full capabilities. 

The HTML file uses VBScript to automate object creation and analysis.

The scenario comes with a sample RCS file.</description>
    </item>
    <item>
      <title>NMEA GPS Import Utilities</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=NMEA_File_Reader_Smoother.zip&amp;campaignId=403&amp;page=/codeExchange</link>
      <description>These utilities create STK Objects from a file containing NMEA sentenses. 

Specifically, $GPGGA and $GPRMC sentenses are required.</description>
    </item>
    <item>
      <title>YPR Rates</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=yprrates.zip&amp;campaignId=405&amp;page=/codeExchange</link>
      <description>This MATLAB script converts YRP angles in any sequence and the angular velocity vector into YPR rates.  The algorithm uses analytical relationships to output YPR rates.&#xD;
&#xD;
Here are some things to keep in mind when using the script.  The script is made for STK 9, but if you want to use it in STK 8, you need to change line 3 to:&#xD;
&#xD;
stkapp = actxGetRunningServer('STK8.application');&#xD;
&#xD;
Because this grabs the current instance of STK, a satellite named Satellite1 must be in the script for this to work.  You can change the satellite name in line 6 to the name of any vehicle in your scenario (aircraft, ground vehicle, etc), if you like.  &#xD;
&#xD;
Another thing to note is that the script will give you YPR rates for the whole scenario time period.  You can change this in line 12 in the Exec() method.  Lastly, this script uses a matrix inverse function in line 60.  If the matrix becomes poorly defined, it can introduce errors into the rates that are calculated.  Feel free to add an algorithm to take care of this.</description>
    </item>
    <item>
      <title>Drawing Shapes on the Globe</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=ShapeDrawing2.zip&amp;campaignId=410&amp;page=/codeExchange</link>
      <description>This demo includes examples for allowing the user to draw polylines and polygons  by double clicking points on the globe.&#xD;
&#xD;
Polylines:&#xD;
[img]http://blogs.agi.com/insight3d/wp-content/uploads/2010/08/PolylineDrawing.png[/img]&#xD;
&#xD;
Polygons:&#xD;
[img]http://blogs.agi.com/insight3d/wp-content/uploads/2010/08/PolygonDrawing.png[/img]</description>
    </item>
    <item>
      <title>Point in Polygon Test</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=PointInPolygon.zip&amp;campaignId=415&amp;page=/codeExchange</link>
      <description>This example demonstrates how to test if a point on the globe is inside a polygon on the globe.

[img]http://blogs.agi.com/insight3d/wp-content/uploads/2010/08/PointInPolygonTest.png[/img]</description>
    </item>
    <item>
      <title>Orient a Model using a Bearing Angle</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=ModelBearing2.zip&amp;campaignId=416&amp;page=/codeExchange</link>
      <description>This example demonstrates how to orient a model based on a bearing angle.  It creates 100 models, each with a random position and bearing.&#xD;
&#xD;
[img]http://blogs.agi.com/insight3d/wp-content/uploads/2010/08/ModelBearing.png[/img]</description>
    </item>
    <item>
      <title>Route Design Editing Control</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=RouteDesignEditing.zip&amp;campaignId=417&amp;page=/codeExchange</link>
      <description>As seen in the 2010 August webinar: "Building Vehicle Routes with Route Design Library"

This contains two WinForms User Control projects.  One handles animation, the other handles the user input with the keyboard and mouse to allow clickable selection and editing of a route using AGI Components: Route Design Library.  

(AGI Components and analytical terrain sold separately)</description>
    </item>
    <item>
      <title>Drag and Drop a Marker</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=DragAndDropMarker.zip&amp;campaignId=420&amp;page=/codeExchange</link>
      <description>This example demonstrates how to use the left mouse button to drag and drop a marker.  Hit the escape key during dragging to cancel.

The marker is colored green when the mouse moves over it, indicating it can be dragged.  During a drag, the marker is colored blue.

[img]http://blogs.agi.com/insight3d/wp-content/uploads/2010/08/DragAndDropMarker.png[/img]</description>
    </item>
    <item>
      <title>AMM Object Model Example</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=AMMVBExample.zip&amp;campaignId=421&amp;page=/codeExchange</link>
      <description>This is a custom application that creates an AMM aircraft.  The interface is very simple.  This is just made to show some AMM Object Model code, which is completely undocumented.</description>
    </item>
    <item>
      <title>Visualizing Vectors</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=Vector.zip&amp;campaignId=422&amp;page=/codeExchange</link>
      <description>This example demonstrates how to visualize vectors using solid primitives.

[img]http://blogs.agi.com/insight3d/wp-content/uploads/2010/08/VisualizingVectors.png[/img]</description>
    </item>
    <item>
      <title>Coverage at Altitude UI Plugin</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=CovAtAlt.zip&amp;campaignId=423&amp;page=/codeExchange</link>
      <description>This UI Plugin example shows how to enable a Coverage such that it draws at the defined altitude in the 3D window.</description>
    </item>
    <item>
      <title>MATLAB FOM:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=FOMDataPrv1.zip&amp;campaignId=98&amp;page=/codeExchange</link>
      <description>This is a quick snippet that gets the "Figure of Merit: Time Value by Point" data provider values: Latitude, Longitude and FOM Value.</description>
    </item>
    <item>
      <title>STKX/4DX Application -  MFCMDI:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=CPP_MDI.zip&amp;campaignId=103&amp;page=/codeExchange</link>
      <description>This example was created with Visual Studio 6 in C++  and MFC 4.21. It demonstrates:&#xD;
[list]&#xD;
[*]MDI application with the ability to create multiple Map and Globe windows&#xD;
[*]how to sink the STK X application object connection points&#xD;
[*]how to use the Map and Globe controls in views (i.e. classes derived from CView), and&#xD;
[*]how to sink the events in a CView derived class&#xD;
[/list]</description>
    </item>
    <item>
      <title>STKX/4DX Application -  PlaceFinder:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=PlaceFinder.zip&amp;campaignId=104&amp;page=/codeExchange</link>
      <description>This example was created with C# and Visual Studio .NET 2003 and involves a Windows form using the Globe control. It demonstrates:&#xD;
&#xD;
[list]&#xD;
[*]how to implement an application-specific context menu,&#xD;
[*]how to extract or pick information from the Globe control,&#xD;
[*]how to use the TerraServer web service to create facilities on the Globe&#xD;
[/list]</description>
    </item>
    <item>
      <title>STKX/4DX Application - GISDemo:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=GISDemo.zip&amp;campaignId=105&amp;page=/codeExchange</link>
      <description>This example shows how to use the 4DX automation interface combined with ArcObjects to display GIS data in a VO Control in a 4dx application.</description>
    </item>
    <item>
      <title>STKX/4DX Application - 3DSituationViewerVO:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=3DSituationViewerVO.zip&amp;campaignId=107&amp;page=/codeExchange</link>
      <description>This is an HTML/VBScript example providing a user interface for the 3-D Situation Viewer task.</description>
    </item>
    <item>
      <title>STKX/4DX Application - ConnectDemo:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=ConnectDemo.zip&amp;campaignId=109&amp;page=/codeExchange</link>
      <description>An HTML page with Map and Globe controls ready to receive connect commands through socket 5001.</description>
    </item>
    <item>
      <title>STKX/4DX Application - gmdvo:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=gmdvo.zip&amp;campaignId=110&amp;page=/codeExchange</link>
      <description>This is an HTML example that demonstrates mouse events and picking in HTML. It is used to assess the likelihood of detection of an intercontinental missile attack.</description>
    </item>
    <item>
      <title>STKX/4DX Application - thaaddvo:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=thaadvo.zip&amp;campaignId=112&amp;page=/codeExchange</link>
      <description>This HTML/VBScript example assesses the placement of theatre missile defense radars.</description>
    </item>
    <item>
      <title>STKX/4DX Application - AGI Java Wrapper:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=Java_AGI.zip&amp;campaignId=113&amp;page=/codeExchange</link>
      <description>A variety of java samples using the AGI Java Wrapper, such as:  &#xD;
[list]&#xD;
[*]AllowScrollbars&#xD;
[*]AnimateModes&#xD;
[*]DrawRects&#xD;
[*]Events&#xD;
[*]MapProjections&#xD;
[*]RubberbandSelect&#xD;
[*]TabPanes&#xD;
[*]etc...&#xD;
[/list]&#xD;
Note:  this is the only java wrapper AGI will support.</description>
    </item>
    <item>
      <title>STKX/4DX Application - JIntegra Java Wrapper:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=Java_JIntegra.zip&amp;campaignId=114&amp;page=/codeExchange</link>
      <description>A variety java samples using the JIntegra Java Wrapper.</description>
    </item>
    <item>
      <title>STKX/4DX Application - SWT Java Wrapper:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=Java_SWT.zip&amp;campaignId=115&amp;page=/codeExchange</link>
      <description>A variety of java samples using the SWT Java Wrapper.</description>
    </item>
    <item>
      <title>Combination Generator</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=CombinationGenerator.zip&amp;campaignId=116&amp;page=/codeExchange</link>
      <description>This snippet will generate combinations of n items taken r at a time.  This is useful if you want to remove GPS satellites one or two at a time to see the effects on the Dilution of Precision or Accuracy</description>
    </item>
    <item>
      <title>Navigation Accuracy Example</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=NavAccExample.zip&amp;campaignId=117&amp;page=/codeExchange</link>
      <description>This short program computes navigation accuracy at one location for one time.  It shows you how to use the Navigation Accuracy Library to setup a GPS receiver and use evaluators to generate accuracy results.</description>
    </item>
    <item>
      <title>STKX/4DX Application - PowerPoint: 3D Window Example</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=3D Window Example.zip&amp;campaignId=119&amp;page=/codeExchange</link>
      <description>In this example, a Globe control is embedded in PowerPoint presentation. It demonstrates how to drive the Globe control from VBA and a PowerPoint macro.</description>
    </item>
    <item>
      <title>STKX/4DX Application - AllowScrollbars</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=AllowScrollbars.zip&amp;campaignId=120&amp;page=/codeExchange</link>
      <description>This example using the Map control demonstrates zoom in/zoom out with the Map control and the ability to turn off scrollbars.</description>
    </item>
    <item>
      <title>STKX/4DX Application - AllowScrollbars</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=AllowScrollbars.zip&amp;campaignId=121&amp;page=/codeExchange</link>
      <description>This example using the Map control demonstrates zoom in/zoom out with the Map control and the ability to turn off scrollbars.</description>
    </item>
    <item>
      <title>STKX/4DX Application - AllowScrollbars:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=AllowScrollBars.zip&amp;campaignId=122&amp;page=/codeExchange</link>
      <description>This example using the Map control demonstrates zoom in/zoom out with the Map control and the ability to turn off scrollbars.</description>
    </item>
    <item>
      <title>STKX/4DX Application - Events:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=Events.zip&amp;campaignId=123&amp;page=/codeExchange</link>
      <description>This example using both the Map and Globe controls demonstrates:&#xD;
[list]&#xD;
[*]how to connect to mouse and keyboard events with Map and Globe controls&#xD;
[*]how to get pick information from the Globe control&#xD;
[*]zoom in/zoom out with the Map control, and&#xD;
[*]catching application events&#xD;
[/list]</description>
    </item>
    <item>
      <title>STKX/4DX Application - Events:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=Events.zip&amp;campaignId=124&amp;page=/codeExchange</link>
      <description>This example using both the Map and Globe controls demonstrates:&#xD;
[list]&#xD;
[*]how to connect to mouse and keyboard events with Map and Globe controls&#xD;
[*]how to get pick information from the Globe control&#xD;
[*]zoom in/zoom out with the Map control, and&#xD;
[*]catching application events&#xD;
[/list]</description>
    </item>
    <item>
      <title>STKX/4DX Application - Events:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=Events.zip&amp;campaignId=125&amp;page=/codeExchange</link>
      <description>This example using both the Map and Globe controls demonstrates:&#xD;
[list]&#xD;
[*]how to connect to mouse and keyboard events with Map and Globe controls&#xD;
[*]how to get pick information from the Globe control&#xD;
[*]zoom in/zoom out with the Map control, and&#xD;
[*]catching application events&#xD;
[/list]</description>
    </item>
    <item>
      <title>STKX/4DX Application - DragAndDrop:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=DragAndDrop.zip&amp;campaignId=126&amp;page=/codeExchange</link>
      <description>This example demonstrates the drag and drop capabilities of the STK X controls.</description>
    </item>
    <item>
      <title>STKX/4DX Application - DragAndDrop:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=DragAndDrop.zip&amp;campaignId=127&amp;page=/codeExchange</link>
      <description>This example demonstrates the drag and drop capabilities of the STK X controls.</description>
    </item>
    <item>
      <title>STKX/4DX Application - DragAndDrop:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=DragAndDrop.zip&amp;campaignId=128&amp;page=/codeExchange</link>
      <description>This example demonstrates the drag and drop capabilities of the STK X controls.</description>
    </item>
    <item>
      <title>STKX/4DX Application - DrawRects:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=DrawRects.zip&amp;campaignId=129&amp;page=/codeExchange</link>
      <description>This example demonstrates the ability to draw bounding rectangles. This capability is useful when implementing custom rubber band selection.</description>
    </item>
    <item>
      <title>STKX/4DX Application - DrawRects:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=DrawRects.zip&amp;campaignId=130&amp;page=/codeExchange</link>
      <description>This example demonstrates the ability to draw bounding rectangles. This capability is useful when implementing custom rubber band selection.</description>
    </item>
    <item>
      <title>STKX/4DX Application - DrawRects:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=DrawRects.zip&amp;campaignId=131&amp;page=/codeExchange</link>
      <description>This example demonstrates the ability to draw bounding rectangles. This capability is useful when implementing custom rubber band selection.</description>
    </item>
    <item>
      <title>STKX/4DX Application - OnAnimUpdate:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=OnAnimUpdate.zip&amp;campaignId=132&amp;page=/codeExchange</link>
      <description>This example demonstrates the OnAnimUpdate event fired by STK X. This event can be used to synchronize other processes and GUI elements with the animation. In the example the event is used to display information in the status bar.</description>
    </item>
    <item>
      <title>STKX/4DX Application - OnAnimUpdate:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=OnAnimUpdate.zip&amp;campaignId=133&amp;page=/codeExchange</link>
      <description>This example demonstrates the OnAnimUpdate event fired by STK X. This event can be used to synchronize other processes and GUI elements with the animation. In the example the event is used to display information in the status bar.</description>
    </item>
    <item>
      <title>STKX/4DX Application - OnAnimUpdate:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=OnAnimUpdate.zip&amp;campaignId=134&amp;page=/codeExchange</link>
      <description>This example demonstrates the OnAnimUpdate event fired by STK X. This event can be used to synchronize other processes and GUI elements with the animation. In the example the event is used to display information in the status bar.</description>
    </item>
    <item>
      <title>STKX/4DX Application - RubberBandSelect:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=RubberBandSelect.zip&amp;campaignId=135&amp;page=/codeExchange</link>
      <description>This example demonstrates how to implement rubber-band selection and get the list of the objects selected by the user.</description>
    </item>
    <item>
      <title>STKX/4DX Application - RubberBandSelect:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=RubberBandSelect.zip&amp;campaignId=136&amp;page=/codeExchange</link>
      <description>This example demonstrates how to implement rubber-band selection and get the list of the objects selected by the user.</description>
    </item>
    <item>
      <title>STKX/4DX Application - RubberBandSelect:</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=RubberBandSelect.zip&amp;campaignId=137&amp;page=/codeExchange</link>
      <description>This example demonstrates how to implement rubber-band selection and get the list of the objects selected by the user.</description>
    </item>
    <item>
      <title>Where is ISS?</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=WhereIsISSX1.zip&amp;campaignId=151&amp;page=/codeExchange</link>
      <description>A basic HTML application that will determine the exact times when you can see the International Space Station from your location of choice.</description>
    </item>
    <item>
      <title>South Atlantic Anomaly entry and exit times</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=SAA.zip&amp;campaignId=155&amp;page=/codeExchange</link>
      <description>this html utility computes the entry and exit times for the South Atlantic Anomaly using various user-specified models</description>
    </item>
    <item>
      <title>Connecting to STK from Matlab</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=&amp;campaignId=156&amp;page=/codeExchange</link>
      <description>Methods for getting a hold on the STK object model root from within Matlab.  Below is how to grab a handle to an open instance of STK or how to create an instance of STK through Matlabs Actxserver functionality.

[code] 
%if STK is not open..
%start it all off - create COM object
STK = actxserver('STK8.application');

%if STK is open...
STK = actxGetRunningServer('STK8.application');

%get the object model root
root = STK.Personality2; [/code]</description>
    </item>
    <item>
      <title>Perl_STK-TCPIP-CONNECT_Example.pl</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=&amp;campaignId=157&amp;page=/codeExchange</link>
      <description>[code]&#xD;
use Stk;&#xD;
&#xD;
# this perl module - Stk.pm - can be found in the &lt;STK-INSTALL&gt;\Connect\PERL_LIB directory&#xD;
&#xD;
Connect_to_STK(5001, localhost, STK);&#xD;
&#xD;
# $result will be either ACK or NACK&#xD;
&#xD;
$result = ProcessConnectCommand(STK, "New / Scenario MyScen");&#xD;
print "\nNewScen result = $result";&#xD;
&#xD;
$result = ProcessConnectCommand(STK, "New / */Facility MyFac");&#xD;
print "\nNewFac  result = $result";&#xD;
&#xD;
ProcessConnectCommand(STK, "SetPosition */Facility/MyFac Geodetic 37.9 -75.5 0.0");&#xD;
ProcessConnectCommand(STK, "New / */Satellite MySat");&#xD;
ProcessConnectCommand(STK, "SetState */Satellite/MySat Cartesian J4Perturbation \"1 Jan 2004 00:00:00.00\" \"2 Jan 2004 00:00:00.00\" 60 J2000 \"1 Jan 2004 00:00:00.00\" -5465000.513055 4630000.194365 0.0 712.713627 841.292034 7377.687805");&#xD;
&#xD;
# @returnedData will be the data STK returns over the socket&#xD;
&#xD;
$result = ProcessConnectCommand(STK, "AllInstanceNames /", \@returnedData);&#xD;
print "\nAllName result = $result";&#xD;
&#xD;
foreach (@returnedData){&#xD;
	print "\n\tReturned: $_";&#xD;
	}&#xD;
&#xD;
$result = ProcessConnectCommand(STK, "GetReport */Satellite/MySat \"LLA Position\"", \@returnedData);&#xD;
print "\GetReport result = $result";&#xD;
&#xD;
foreach (@returnedData){&#xD;
	print "\n\tReturned: $_";&#xD;
	}&#xD;
[/code]</description>
    </item>
    <item>
      <title>Perl_STK-COM-CONNECT_Example.pl</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=&amp;campaignId=158&amp;page=/codeExchange</link>
      <description>[code]&#xD;
use STK::COM;&#xD;
&#xD;
# this perl module - STK::COM - can be found in the &lt;STK-INSTALL&gt;\Connect\PERL_LIB\Perl5.8Modules\STK-COM-2.0 directory&#xD;
&#xD;
&#xD;
if (! ($STKHANDEL = COM_GetStkComObj())) { # returns a handle to a currently running STK COM object&#xD;
	print "\nStarting STK COM object";&#xD;
	$STKHANDEL = COM_OpenStkComObj();  # start a STK COM object and return its handle&#xD;
	}&#xD;
&#xD;
COM_ProcessConnectCommand($STKHANDEL, "SetUnits / METER");&#xD;
&#xD;
&#xD;
#example commands - return ACK or NACK,&#xD;
$result = COM_ProcessConnectCommand($STKHANDEL, "New / Scenario MyScen");&#xD;
print "\nNewScen result = $result";&#xD;
&#xD;
$result = COM_ProcessConnectCommand($STKHANDEL, "New / */Facility MyFac");&#xD;
print "\nNewFac  result = $result";&#xD;
&#xD;
$result = COM_ProcessConnectCommand($STKHANDEL, "SetPosition */Facility/MyFac Geodetic 37.9 -75.5 0.0");&#xD;
$result = COM_ProcessConnectCommand($STKHANDEL, "New / */Satellite MySat");&#xD;
$result = COM_ProcessConnectCommand($STKHANDEL, "SetState */Satellite/MySat Cartesian J4Perturbation \"1 Jan 2004 00:00:00.00\" \"2 Jan 2004 00:00:00.00\" 60 J2000 \"1 Jan 2004 00:00:00.00\" 6678137 0 0 0 6046.242976 4809.398824");&#xD;
&#xD;
#example commands - return ACK or NACK,as well as data from STK&#xD;
$result = COM_ProcessConnectCommand($STKHANDEL, "AllInstanceNames /", \@returnedData);&#xD;
print "\nAllName result = $result";&#xD;
&#xD;
foreach (@returnedData){&#xD;
	print "\n\tReturned: $_";&#xD;
	}&#xD;
&#xD;
&#xD;
$result = COM_ProcessConnectCommand($STKHANDEL, "GetReport */Satellite/MySat \"LLA Position\"", \@retData);&#xD;
print "\nGetReport result = $result";&#xD;
&#xD;
foreach (@retData){&#xD;
	print "\n\tReturned: $_";&#xD;
	}&#xD;
[/code]</description>
    </item>
    <item>
      <title>Perl_STK-ObjectModel_Example.pl</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=&amp;campaignId=159&amp;page=/codeExchange</link>
      <description>[code]&#xD;
use Win32::OLE;&#xD;
use Win32::OLE::Variant;&#xD;
use Win32::OLE::Enum;&#xD;
$|=1;&#xD;
&#xD;
#&#xD;
# use existing instance of STK if already running, else start new&#xD;
#&#xD;
if (! ($STKapp = Win32::OLE-&gt;GetActiveObject('STK8.Application'))){&#xD;
	&#xD;
	$STKapp = Win32::OLE-&gt;new('STK8.Application');&#xD;
	&#xD;
	}&#xD;
	&#xD;
$STKapp-&gt;{Visible}	= 0;&#xD;
$STKapp-&gt;{UserControl}	= True;&#xD;
$STKpers = $STKapp-&gt;{Personality2};&#xD;
&#xD;
&#xD;
if (! SendCommand("CheckScenario /")){&#xD;
	$STKpers-&gt;NewScenario("DEMO-TEST");&#xD;
	}&#xD;
$STKapp-&gt;{Visible}	= 1;&#xD;
$STKapp-&gt;{UserControl}	= True;&#xD;
&#xD;
&#xD;
$STKpers_Children = $STKpers-&gt;{Children};&#xD;
$num = $STKpers_Children-&gt;{Count};&#xD;
print "num children = $num \n";&#xD;
&#xD;
$Scenario_Collection = $STKpers_Children-&gt;Item(0);&#xD;
$Scenario_Name = $Scenario_Collection-&gt;InstanceName;&#xD;
print "Scenario_Name = $Scenario_Name \n";&#xD;
&#xD;
$HasChildren = $Scenario_Collection-&gt;HasChildren;&#xD;
print"HasChildren = $HasChildren \n";&#xD;
&#xD;
if ($HasChildren)&#xD;
{&#xD;
    $Sc_Children = $Scenario_Collection-&gt;{Children};&#xD;
    $num = $Sc_Children-&gt;{Count};&#xD;
    print "num = $num \n";&#xD;
    for($i = 0; $i &lt; $num; $i++)&#xD;
    {&#xD;
        $Sc_Child = $Sc_Children-&gt;Item($i);&#xD;
        $Child_Name = $Sc_Child-&gt;InstanceName;&#xD;
        print "Child_Name = $Child_Name \n";&#xD;
    }&#xD;
&#xD;
}&#xD;
&#xD;
&#xD;
#&#xD;
# Reset Animation &#xD;
#&#xD;
$STKpers-&gt;Reset();&#xD;
&#xD;
#&#xD;
# Begin Animation &#xD;
#&#xD;
$STKpers-&gt;PlayForward();&#xD;
&#xD;
#&#xD;
# Get current animation time (epoch sces is the default)&#xD;
#&#xD;
for (1 .. 5){&#xD;
	print "\nANIM TIME = " . $STKpers-&gt;CurrentTime();&#xD;
	sleep (1);&#xD;
	}&#xD;
#&#xD;
# Stop Animation &#xD;
#&#xD;
$STKpers-&gt;Pause();&#xD;
&#xD;
#&#xD;
# Set the animation time&#xD;
#&#xD;
$STKpers-&gt;{CurrentTime} = 1223;&#xD;
&#xD;
&#xD;
print "\nDONE";&#xD;
&#xD;
########################&#xD;
&#xD;
sub SendCommand {&#xD;
	my($ConnectCommand) = @_;&#xD;
	my(@return_array) = "";	&#xD;
	my ($ret) =  $STKpers-&gt;Invoke(ExecuteCommand,$ConnectCommand); &#xD;
	if ($ret){&#xD;
		foreach my $value (in $ret) {&#xD;
			push (@return_array, $value);&#xD;
			}&#xD;
		shift (@return_array);&#xD;
		if (! $#return_array){&#xD;
			return ($return_array[0]);&#xD;
			}&#xD;
		return (@return_array);&#xD;
		}&#xD;
	else {&#xD;
		return (0);&#xD;
		}&#xD;
	}&#xD;
[/code]</description>
    </item>
    <item>
      <title>Perl_STK-ObjectModel_DataProviders_Example.pl</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=Perl_STK-ObjectModel_DataProviders_Example1.zip&amp;campaignId=160&amp;page=/codeExchange</link>
      <description>Here's an example showing how to use Perl to pull data from STK's Data Providers via ObjectModel.</description>
    </item>
    <item>
      <title>STK-Report_Post_Processing</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=post_processing_scripts.zip&amp;campaignId=161&amp;page=/codeExchange</link>
      <description>This is a collection of post processing scripts (pps) for use in STK. You can create a pps and assign it to an STK report. The script modifiies the output as desired for displaying/saving/exporting the data.</description>
    </item>
    <item>
      <title>Perl_STK-ObjectRootEvents.pl</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=&amp;campaignId=162&amp;page=/codeExchange</link>
      <description>[code] &#xD;
use Win32::GUI;&#xD;
use Win32::OLE;&#xD;
use Win32::OLE qw(EVENTS);&#xD;
&#xD;
$| = 1;&#xD;
&#xD;
new Win32::GUI::Window();&#xD;
	&#xD;
$stkRoot = Win32::OLE-&gt;GetActiveObject("STK.Application") -&gt; {Personality2};&#xD;
&#xD;
Win32::OLE-&gt;WithEvents($stkRoot, \&amp;STKEvents, "IAgStkObjectRootEvents");&#xD;
&#xD;
Win32::GUI::Dialog();&#xD;
&#xD;
sub STKEvents {&#xD;
	my ($Obj,$Event,@Args) = @_;&#xD;
	print "\n$Event";&#xD;
	for ($i = 0; $i &lt;= $#Args; $i++){&#xD;
		print "\n\tARG" . $i . "  " . $Args[$i];&#xD;
		}	&#xD;
	}&#xD;
[/code]</description>
    </item>
    <item>
      <title>Custom noise model - ionospheric error</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=IonosphericNoiseModel.zip&amp;campaignId=181&amp;page=/codeExchange</link>
      <description>This code shows how to create a custom noise error model for the Navigation library.  Custom noise models are nice because you can add any type of system behavior you want and it will be added in with the errors produced from the PAF or PSF files.</description>
    </item>
    <item>
      <title>Ephemeris Differencer</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=EphemerisDifferencer9.zip&amp;campaignId=187&amp;page=/codeExchange</link>
      <description>Ephemeris Differencer is a simple mini-Application which takes two ephemeris files (STK ".e" or TwoLineElements ".tle") or manually entered Cartesian or Keplerian initial conditions.  The differencer can analyze the following:&#xD;
- Cartesian error in Earth Inertial&#xD;
- Cartesian error in Earth Fixed&#xD;
- Radial-InTrack-CrossTrack Error&#xD;
- Apparent vs True displacement, accounting for light travel time&#xD;
- Units in Kilometers or Meters&#xD;
&#xD;
If the "Account for Light Travel Time" option is turned on, the difference will be expressed in terms of the ApparentDisplacement rather than the instantaneous TrueDisplacement.&#xD;
&#xD;
Keywords: ephemeris trajectory error difference comparison</description>
    </item>
    <item>
      <title>STKX/4DX Application - Simple WMS Client</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=SimpleWMSClient.zip&amp;campaignId=191&amp;page=/codeExchange</link>
      <description>This example demonstrates how to use 4DX and ESRI ArcGIS in your custom application. It consumes a WMS service using the STKesriDisplay type library and ArcObjects. &#xD;
&#xD;
ArcGIS 9.2 is required. You can use either:&#xD;
       a. ArcGIS Desktop (ArcMap).&#xD;
or&#xD;
       b. ArcGIS Engine with AGI GIS Analyst license.&#xD;
&#xD;
A discussion of this example and a video showing it in action can be found on the 4DX blog.</description>
    </item>
    <item>
      <title>STKX/4DX Application - ArcGIS Online demo</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=ArcGISOnlineDemo.zip&amp;campaignId=192&amp;page=/codeExchange</link>
      <description>This example demonstrates how to use STK Engine and ESRI ArcGIS in your custom application. It consumes ArcGIS Online services (see http://www.esri.com/software/arcgis/arcgisonline) using the STKesriDisplay type library and ArcObjects. &#xD;
&#xD;
ArcGIS 9.2 is required. You can use either: &#xD;
       a. ArcGIS Desktop (ArcMap). &#xD;
or &#xD;
       b. ArcGIS Engine with AGI GIS Analyst license. &#xD;
You also need an ArcGIS Online account (available for free from the above URL).&#xD;
&#xD;
A discussion of this example and a video showing it in action can be found on the STK Engine blog.</description>
    </item>
    <item>
      <title>Astrogator Connect - Complete Example</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=Astrogator_Connect_Complete_Example.zip&amp;campaignId=193&amp;page=/codeExchange</link>
      <description>This is a series of Connect commands that can be used to create, configure, and run an complete Astrogator satellite. The specific MCS it creates achieves no purpose other than illustrating many of the common things you would want to do through Connect.</description>
    </item>
    <item>
      <title>MATLAB GUI with embedded STKX</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=MATLAB_GUI_stkx1.zip&amp;campaignId=194&amp;page=/codeExchange</link>
      <description>This example is a MATLAB-created GUI with an embedded 3D window. It was created using MATLAB's "guide" tool and adding an "AGI Globe Control 8" ActiveX control.&#xD;
&#xD;
**Updated 18 Jul 2008 to include a missing file**</description>
    </item>
    <item>
      <title>Data Providers via Object Model in MATLAB</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=MatlabSTKObjModel.zip&amp;campaignId=196&amp;page=/codeExchange</link>
      <description>These code snippets demonstrate how to establish a COM connection to STK from MATLAB and how to retrieve data from standard and access-based data providers.</description>
    </item>
    <item>
      <title>Frequency Hopping Transmitter Model Plugin</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=FreqHop.zip&amp;campaignId=197&amp;page=/codeExchange</link>
      <description>The attached scenario uses a plugin script to model a frequency hopping transmitter. The frequency varies with the range between transmitter and receiver. The transmitter is on a Low Earth Orbiting satellite and the receiver is on the ground. The accompanying VBscript/Perl/MATLAB scripts are in the scenario folder attached.</description>
    </item>
    <item>
      <title>Sun and Moon rise/set times</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=SunMoonTimes.zip&amp;campaignId=198&amp;page=/codeExchange</link>
      <description>this script computes Sun and Moon rise/set times given a location, start date and duration. The times are returned in the local time of the location.</description>
    </item>
    <item>
      <title>Astrogator COM via MATLAB</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=AstrogatorCOMviaMATLAB.zip&amp;campaignId=202&amp;page=/codeExchange</link>
      <description>This script contains example code snippets demonstrating how to work with the original Astrogator COM interface via MATLAB. It is not meant to be executed in its current state, but rather provide useful reference material.It presumes the existence of a scenario containing an Astrogator satellite. The actual configuration of the satellite is not relevant except that segments, profiles, results, etc... matching the names below must be set up before running.</description>
    </item>
    <item>
      <title>Astrogator COM via JavaScript</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=AstrogatorCOMviaJavaScript.zip&amp;campaignId=203&amp;page=/codeExchange</link>
      <description>This script contains example code snippets demonstrating how to work with the original Astrogator COM interface via JavaScript. It is not meant to be executed in its current state, but rather provide useful reference material.It presumes the existence of a scenario containing an Astrogator satellite. The actual configuration of the satellite is not relevant except that segments, profiles, results, etc... matching the names below must be set up before running.</description>
    </item>
    <item>
      <title>How to turn off Ground Vehicle Label</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=&amp;campaignId=204&amp;page=/codeExchange</link>
      <description>The process is a little bit different than for a facility.  For GVs, you have to turn of the scenario inheritance.</description>
    </item>
    <item>
      <title>How to access LLA State data provider of a facility in Matlab</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=&amp;campaignId=205&amp;page=/codeExchange</link>
      <description>Need to have a facility in your scenario called Facility1</description>
    </item>
    <item>
      <title>WhereIsISS: C#</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=CSharp_WhereIsISS.zip&amp;campaignId=206&amp;page=/codeExchange</link>
      <description>This is a C# version of the WhereIsISS application built in the STK Programmers Training.&#xD;
&#xD;
Note the use of Data Providers, STK Object creation and Constraint applications.</description>
    </item>
    <item>
      <title>get Connect return data using Matlab COM</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=&amp;campaignId=207&amp;page=/codeExchange</link>
      <description>h = actxserver('STK8.application');
h.Visible = 1;

stk=h.Personality2;

stk.ExecuteCommand('New / Scenario Test');
stk.ExecuteCommand('New / */Ship TestShip');
stk.ExecuteCommand('AddWaypoint */Ship/TestShip DetVelFromTime LatLon 30.48874996 -78.84620711 0 "1 Jul 2007 12:00:00.000"');
stk.ExecuteCommand('AddWaypoint */Ship/TestShip DetVelFromTime LatLon 34.205 -74.479 0 "1 Jul 2007 14:05:41.34"');
stk.ExecuteCommand('AddWaypoint */Ship/TestShip DetVelFromTime LatLon 41.399 -67.195 0 "1 Jul 2007 17:46:43.842"');
stk.ExecuteCommand('AddWaypoint */Ship/TestShip DetVelFromTime LatLon 40.392 -57.121 0 "1 Jul 2007 20:51:33.674"');
report = stk.ExecuteCommand('Report_RM */Ship/TestShip Style "LLA Position"');
numLines=report.Count;

for i=0:numLines-1
    report.invoke('Item',i);
end</description>
    </item>
    <item>
      <title>C++ Sample Addin for Custom Application Framework</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=CppAddinExample.zip&amp;campaignId=211&amp;page=/codeExchange</link>
      <description>A sample C++ add-in project for your reference.</description>
    </item>
    <item>
      <title>Python-STKX_Examples.zip</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=Python-STKX_Examples.zip&amp;campaignId=212&amp;page=/codeExchange</link>
      <description>This attachment contains a example of using STKX with Python (the same example is used with STKXv6, STKXv7, and STKXv8).</description>
    </item>
    <item>
      <title>Python-STK-Connect_Examples.zip</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=Python-STK-Connect_Examples.zip&amp;campaignId=213&amp;page=/codeExchange</link>
      <description>Here's a few examples of using Python with STK - TCP/IP and COM examples included.</description>
    </item>
    <item>
      <title>Ionospheric Error Analyst</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=IonoErrorAnalyst.zip&amp;campaignId=214&amp;page=/codeExchange</link>
      <description>The Ionospheric Error Analyst uses the Navigation Accuracy Library, the STK Engine (4DX) and near real time data from NOAA to calculate navigation errors due to the GPS constellation and the ionosphere.  See the blog on this application here: [url=http://blogs.agi.com/navigationAccuracy/?p=83]The Nog[/url]</description>
    </item>
    <item>
      <title>Matlab, ObjectModel, and Events</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=MatlabObjectModel.zip&amp;campaignId=217&amp;page=/codeExchange</link>
      <description>Example on how to utilize the STK object model inside the Matlab environment. Shows how to utilize data providers and event handling (for the root object) as well</description>
    </item>
    <item>
      <title>atbLLAtoCBF example</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=atbLLAtoCBF_example.zip&amp;campaignId=219&amp;page=/codeExchange</link>
      <description>This application will take an input LLA and rates and propagate a missile forward from t0 to t1.  Then it reports the missiles new LLA and rates at t1.

Designed as an example of how to use atbLLAtoCBF function and then put the output into a Connect command.</description>
    </item>
    <item>
      <title>Example of how to use MATLAB and COM with Data Providers</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=ObjModelReports.zip&amp;campaignId=220&amp;page=/codeExchange</link>
      <description>Uses COM interface to talk from MATLAB to STK.  Uses some ExecuteCommand interfaces to setup a scenario.
Then pulls a report from STK using the Object Model.

Reports are extracted using 2 different approaches.

First, a report is extracted between a start and stop time at a user defined step.

Second, a report is extracted using a loop to request the data at specific individual times.</description>
    </item>
    <item>
      <title>Body Mask Matrix mapping</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=BodyMaskSurvey.zip&amp;campaignId=221&amp;page=/codeExchange</link>
      <description>This application takes an existing scenario and creates a point in the aircraft's body frame.  The file will move the point around the body and determines if there's access at each point.

The result is a matrix of 1's and 0's that indicate if there is access at that point around the object.</description>
    </item>
    <item>
      <title>GPSConstellationPlugin</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=GPSConstellationPlugin1.zip&amp;campaignId=222&amp;page=/codeExchange</link>
      <description>This GPSConstellationPlugin shows how to use the AGI Components in any .Net application.  This example shows how to propagate GPS satellite orbits and provides methods that retrieve the orbital positions and velocities.</description>
    </item>
    <item>
      <title>ReportGenerator</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=ReportGenerator.zip&amp;campaignId=224&amp;page=/codeExchange</link>
      <description>This was originally created to automate the process of determining access times from a selected group of facilities (in a constellation) to a satellite.  Upon load, the html page ingests all of the available facilities and satellites in the scenario.  The user is then able to multi-select facilities, and choose one satellite from a drop down list.</description>
    </item>
    <item>
      <title>Navacc Scenario Creator</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=NavaccScenarioCreator.zip&amp;campaignId=231&amp;page=/codeExchange</link>
      <description>This utility creates a navigation accuracy scenario. Contains htm for both STKv8 and STKv9. The STKv9 version takes advantage of the new GPS Propagator. You can run these utilities using local files, or if you register the included ActiveX control (mpsControl.dll), you can point to urls.</description>
    </item>
    <item>
      <title>Astrogator Parameter Search</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=ParameterSearch.zip&amp;campaignId=233&amp;page=/codeExchange</link>
      <description>Astrogator search plugin to find the best combination of rounding control values to some precision, after a differential corrector has found the ideal solution.  Full desciption on [url=http://blogs.agi.com/astrogator/?p=8]astrogator blog[/url].</description>
    </item>
    <item>
      <title>Attitude Integration Plugin</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=AttEngIntegratedPlugin.zip&amp;campaignId=234&amp;page=/codeExchange</link>
      <description>This zip file contains a merged plugin that will integrate torques and return the attitude based on those torques to Astrogator.</description>
    </item>
    <item>
      <title>Automatic Pruning Utility</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=Auto_Pruner.zip&amp;campaignId=237&amp;page=/codeExchange</link>
      <description>This HTML utility uses the VBScript function "setTimeout" to automatically execute connect commands to prune ephemeris, attitude, model articulations, and external data every 18 hours. It is intended to be used in a scenario which reads real-time telemetry for a satellite.</description>
    </item>
    <item>
      <title>GroundVehicle from directions</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=directions2.zip&amp;campaignId=238&amp;page=/codeExchange</link>
      <description>this tool let's you specify start and stop locations, gets directions using Google maps, and then inserts a GroundVehicle from these waypoints. &#xD;
&#xD;
Not sure who originally wrote this script</description>
    </item>
    <item>
      <title>HPOP Atmospheric Model Plugin</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=AtmPlugin1.zip&amp;campaignId=240&amp;page=/codeExchange</link>
      <description>An HPOP force model plugin that will allow a user to define an altitude versus density table for propagation.</description>
    </item>
    <item>
      <title>add multiple GroundVehicles from directions</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=traffic2.zip&amp;campaignId=241&amp;page=/codeExchange</link>
      <description>this script allows you to specify an area where you want to add groundvehicles and it will load as many vehicles as specified. It is based on the "GroundVehicle from Directions" script (http://adn.agi.com/detailedView.cfm?resourceId=248) but uses a loop with random start/stop locations withing the specified area of interest. If you want MTOs instead of GroundVehicles, run this script first and then convert to MTOs using the object utilities (http://adn.agi.com/detailedView.cfm?resourceId=192)</description>
    </item>
    <item>
      <title>Google Earth Satellite Database Source Code</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=AGI.WebApplications.SatelliteDatabase.zip&amp;campaignId=242&amp;page=/codeExchange</link>
      <description>This download contains the full source code and project files for the Google Earth Satellite Database, which is posted in the Web Apps/Services section.  The application generates a KML network link which visualizes all earth orbiting objects tracked by the United States Strategic Command (USSTRATCOM).  All satellites are tracked in real-time and updated every 30 seconds.</description>
    </item>
    <item>
      <title>convert elevation angle to half angle for SAR</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=&amp;campaignId=243&amp;page=/codeExchange</link>
      <description>when defining a SAR sensor, STK uses ground elevation angles while DGL uses sensor half angles. This script converts an elevation angle to a half angle.</description>
    </item>
    <item>
      <title>Custom Application Framework Add-in Source Code: Addins Project</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=Addins.zip&amp;campaignId=244&amp;page=/codeExchange</link>
      <description>Source code for the following standard Custom Application Framework Add-ins:&#xD;
&#xD;
[list=1]&#xD;
[*]Connect&#xD;
[*]Object Properties&#xD;
[*]Scenario Animation Tool&#xD;
[*]Scenario Operations Control&#xD;
[*]Web Browser&#xD;
[*]Windows Media Player&#xD;
[*]Zoom Context Menu&#xD;
[/list]&#xD;
&#xD;
For more information see the [url=http://blogs.agi.com/CAF/?p=17]CAF blog[/url].</description>
    </item>
    <item>
      <title>reporting tool</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=ReportingTool1.zip&amp;campaignId=245&amp;page=/codeExchange</link>
      <description>this tool allows you to create reports using intervals other than time. For example create an "LLA Position" report every 10 degree longitude:&#xD;
&#xD;
Time(EpSec) Lat(deg) Lon(deg) Alt (km)&#xD;
1721.2257   42.0012   10   509.5337&#xD;
1857.9110   38.7887   20   508.3520&#xD;
2011.7916   34.1115   30   506.6916&#xD;
...&#xD;
&#xD;
This tool should allow you create these reports for any report style. It uses the regular time-based report and interpolates between points to only get the data you want.</description>
    </item>
    <item>
      <title>kml from platform</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=Platform2Kml1.zip&amp;campaignId=247&amp;page=/codeExchange</link>
      <description>this class creates a kml file from any DGL platform object. The resulting file can then be leaded into tools like Google Earth</description>
    </item>
    <item>
      <title>ODTK maneuver input automation - Excel</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=ODTK maneuver automation - Excel1.zip&amp;campaignId=249&amp;page=/codeExchange</link>
      <description>This Excel spreadsheet automates the creation of InstantManeuvers in ODTK. It has two pages to model momentum dumps and maneuvers separately.</description>
    </item>
    <item>
      <title>ODTK maneuver input automation - VBS</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=ODTK_maneuver automation - vbs.zip&amp;campaignId=250&amp;page=/codeExchange</link>
      <description>This demonstrates how to add an InstantManeuver to an ODTK satellite using the VBScript interface.</description>
    </item>
    <item>
      <title>ODTK collections and maneuvers - Perl</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=ODTK_collections_and_maneuvers - Perl.zip&amp;campaignId=251&amp;page=/codeExchange</link>
      <description>This shows you how to work with ODTK collections and maneuvers from Perl. Using Perl with ODTK has a few nuances that aren't as straight forward as when using a language like VBScript. One of the biggest issues is that the normal COM interfaces like to return things as Collections, not Arrays. So you have to make sure that your Perl code is expecting this. 

The Win32:OLE package can handle this - check out the documenation for it, particularly the use of the "in" keyword. .
 
For maneuvers, the key is to know that all collections must implement the Count and Item interfaces. This is a OLE requirement. So we can use these when interfacing with Perl.</description>
    </item>
    <item>
      <title>ODTK multi-day automatic processing</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=ODTK_multi-day_processing_vbs.zip&amp;campaignId=252&amp;page=/codeExchange</link>
      <description>This code demonstrates one way of automating the processing of various batches of observations, including running the filter and smoother and generating some products.

It was built for working with TDRS satellites and may reference some external files, so it won't run as-is. But it does demonstrate the interface and a possible workflow for automating the OD process.</description>
    </item>
    <item>
      <title>Satellite overflight ESRI geoprocessing tool</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=ESRI_GeoprocessingTool.zip&amp;campaignId=253&amp;page=/codeExchange</link>
      <description>This tool will operate in ESRI’s ArcToolbox - Geoprocessing framework and compute inter-visibility times from any point feature class to any of the earth science satellites.  End users can pass in any point feature class, time duration and also specify an output file geodatabase.  The tool will create an “OverflightFeatures” feature class inside of the specified file geodatabase.  The feature class will contain the point features that have inter-visibility to any of the Earth Science satellites and also attributes of start, stop and duration of the inter-visibility.</description>
    </item>
    <item>
      <title>VGT and Access Plugin Scripting</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=Int_Cust_with_Plugins.zip&amp;campaignId=255&amp;page=/codeExchange</link>
      <description>Integrating and Customizing STK with Plug-in Scripts

This is the traing exercise from the 2204 User's Conference. It can also be found at https://www.agi.com/events/usersConference/2004/resources/trainingSession.cfm

It uses the older plugin scripting interface to create custom a vector geometry tool vector and a custom access constraint. Examples are provided in VBScript and Matlab.</description>
    </item>
    <item>
      <title>VGT plugin scripting custom vector</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=keepAngleBelowMax.zip&amp;campaignId=256&amp;page=/codeExchange</link>
      <description>This scenario uses Perl or Matlab custom scripts to describe VGT vectors used to define the attitude of a spacecraft. The attitude of the spacecraft is sun-aligned until the boresight is 50 degrees off nadir, at which time it is locked to 50 degrees off nadir in the direction of the sun.</description>
    </item>
    <item>
      <title>Access and AER reports in Excel</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=Excel_AccessAER.zip&amp;campaignId=257&amp;page=/codeExchange</link>
      <description>This example takes a scenario and returns access and AER data providers through the object model in VBA</description>
    </item>
    <item>
      <title>STK HTML Viewer utilities collection</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=2&amp;file=STK HTML Viewer.zip&amp;campaignId=260&amp;page=/codeExchange</link>
      <description>This is a collection of STK HTML Viewer utilities (written in javascript and/or vbscript, using CONNECT commands and/or STK ObjectModel). Here is the complete list of incuded utilities:&#xD;
[list]&#xD;
[*]2DLegend.htm&#xD;
[*]AER_AngleBetween.htm&#xD;
[*]AircraftDataImport.htm&#xD;
[*]AlmanacProp(STKv8).htm&#xD;
[*]AlmanacProp(STKv9).htm&#xD;
[*]AreaTarget_CornerPoints.htm&#xD;
[*]AssetDeactive_Utility.htm&#xD;
[*]brokerPanel.html&#xD;
[*]ChainAccess_SetOperations.htm&#xD;
[*]ChainAccessGapsReport.htm&#xD;
[*]ChainReportParser.htm&#xD;
[*]CommSys-LinkInfo-reporter.htm&#xD;
[*]Convoy.htm&#xD;
[*]createAdvancedRangeRings.htm&#xD;
[*]createPointsFromLine.html&#xD;
[*]createRegionList.htm&#xD;
[*]createSatsFromDotE.htm&#xD;
[*]Data Read.htm&#xD;
[*]DeadZone.htm&#xD;
[*]deckAccess.html&#xD;
[*]DeltaV_Utility.htm&#xD;
[*]directions2.html&#xD;
[*]Excel_to_STK.htm&#xD;
[*]External Ephemeris to MTO.htm&#xD;
[*]falconViewImporter.html&#xD;
[*]File Read.htm&#xD;
[*]Footprint_Area.html&#xD;
[*]fort19toSTK.htm&#xD;
[*]ftp_instructions.htm&#xD;
[*]Generic_File_Reader.htm&#xD;
[*]GetColor.htm&#xD;
[*]getUniqueName.htm&#xD;
[*]GreatArc_UseTerrain.htm&#xD;
[*]GreatArcRoutes.htm&#xD;
[*]HideShowBox.htm&#xD;
[*]HideShowRadius.htm&#xD;
[*]KMLexporter.htm&#xD;
[*]KMLImporter.htm&#xD;
[*]LineTarget-GroundVehicle.htm&#xD;
[*]LineTargetTool.htm&#xD;
[*]LLA2XYZ.htm&#xD;
[*]LoadSats_fm_DeckAccess_rpt1.html&#xD;
[*]LoadSats_fm_DeckAccess_rpt2.html&#xD;
[*]LOSIntersectionAtAltitude.htm&#xD;
[*]MFT_ObjDeploySummary.htm&#xD;
[*]moveLabels.html&#xD;
[*]MoveUtility.htm&#xD;
[*]MTO Converter.htm&#xD;
[*]MTO_GetTimePeriod.htm&#xD;
[*]mtoTool.htm&#xD;
[*]Multi-edit Tool.html&#xD;
[*]NMEAtoSTK.htm&#xD;
[*]NMEAtoSTK-AMM.htm&#xD;
[*]Objects to MTO.htm&#xD;
[*]OilStockTracks2STK.htm&#xD;
[*]ONI_ShipCreator.htm&#xD;
[*]OziExplorer-plt2stk.htm&#xD;
[*]Point ShapeFiles.htm&#xD;
[*]PrimitiveImporterSTKv7.htm&#xD;
[*]PrimitiveImporterSTKv8.htm&#xD;
[*]PriorityAccessTool.htm&#xD;
[*]SAA.html&#xD;
[*]Sat2DGraphicsAttributesInheritableSettings.htm&#xD;
[*]SatViewOnePass.htm&#xD;
[*]ScanningSensor_Utility.htm&#xD;
[*]SEAS_STK_FileGenerator.htm&#xD;
[*]SEAS_STK_FileGenerator_noCommonDialogue.htm&#xD;
[*]SEAS_STK_FileGenerator_noCommonDialogue_noSTKFSO.htm&#xD;
[*]Sensor_Chain_Access_DisplayTimes.htm&#xD;
[*]SetupSensorSchedulingFromSchedulerReport.html&#xD;
[*]ShapeFiles_with_DWELL_TIME-to-STK.htm&#xD;
[*]SingleObjRealTime-example.htm&#xD;
[*]SORBET.htm&#xD;
[*]SP1toSTK.htm&#xD;
[*]SP3toSTK.htm&#xD;
[*]Starburst.htm&#xD;
[*]STKNotes.htm&#xD;
[*]STK-Notes.htm&#xD;
[*]SwathTool.htm&#xD;
[*]Target Creator.htm&#xD;
[*]TCE2MTO.htm&#xD;
[*]template.htm&#xD;
[*]TimetoAccess.htm&#xD;
[*]TmHdgSpdAlt2STK.htm&#xD;
[*]viewBoresight.htm&#xD;
[*]VolumeTool.htm&#xD;
[*]Walker.htm&#xD;
[/list]</description>
    </item>
    <item>
      <title>VB Library to launch STK 8 and process connect commands</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=StartSTK.zip&amp;campaignId=261&amp;page=/codeExchange</link>
      <description>This sample has two projects in the solution, a C# project and a VB project. The VB project is a class library that has methods to launch STK 8 and execute connect commands.
The C# project tests this VB library, by first creating an instance of StartSTK8 class, and then calling Launch to start STK, and finally creating a new scenario using the execute command method.</description>
    </item>
    <item>
      <title>Simple 2 body Sat Propagation</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=&amp;campaignId=263&amp;page=/codeExchange</link>
      <description>JulianDate myJulianEpoch = new JulianDate(DateTime.Now, TimeStandard.CoordinatedUniversalTime);&#xD;
             &#xD;
            Motion&lt;Cartesian&gt; elementsAtEpoch = new Motion&lt;Cartesian&gt;(&#xD;
            new Cartesian(12000000.0, 0.0, 0.0),    // initial position&#xD;
            new Cartesian(0.0, 5763.0, 0.0));       // initial velocity&#xD;
           &#xD;
            TwoBodyPropagator myPropagator = new TwoBodyPropagator(myJulianEpoch, CentralBodiesFacet.GetFromContext().Earth.InertialFrame,elementsAtEpoch,WorldGeodeticSystem1984.GravitationalParameter);&#xD;
            myPropagator.ReferenceFrame.ToString();&#xD;
&#xD;
            DateTime startDate = new DateTime(2007, 6, 1, 12, 0, 0);&#xD;
            DateTime stopDate = new DateTime(2007, 7, 1, 12, 0, 0);&#xD;
            Duration step = Duration.FromSeconds(60.0);&#xD;
&#xD;
            JulianDate startDateJD = new JulianDate(startDate);&#xD;
            JulianDate stopDateJD = new JulianDate(stopDate);&#xD;
&#xD;
            EarthCentralBody earth = CentralBodiesFacet.GetFromContext().Earth;&#xD;
            string dataPath = "C:\\Program Files\\AGI\\STK 8\\DynamicEarthData";&#xD;
            MessageBox.Show(dataPath);&#xD;
            using (StreamReader reader = new StreamReader(Path.Combine(dataPath, "EOP-v1.1.txt")))&#xD;
            {&#xD;
                earth.OrientationParameters = EarthOrientationParametersFile.ReadData(reader);&#xD;
            }&#xD;
&#xD;
            DateMotionCollection&lt;Cartesian&gt; ephemeris = myPropagator.Propagate(startDateJD, stopDateJD, step, 1, earth.FixedFrame);</description>
    </item>
    <item>
      <title>ntLicenseTool</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=ntLicDisplayExclude9.zip&amp;campaignId=279&amp;page=/codeExchange</link>
      <description>This utility will display features served by the STK Daemon (STKD) on the server specified. If on an STK client, you can configure STK by directing the application not to check out specific licenses.</description>
    </item>
    <item>
      <title>MATLAB ScriptEcho</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=7&amp;file=ScriptEcho.zip&amp;campaignId=280&amp;page=/codeExchange</link>
      <description>Echoes dialog information from a MATLAB plulgin into STK</description>
    </item>
    <item>
      <title>STK Connect using TCP/IP</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=STK_Connect_Fortran.zip&amp;campaignId=281&amp;page=/codeExchange</link>
      <description>This is example code showing how to open a TCP/IP socket to STK using FORTRAN. The file "Winsock.f90" contains system functions necessary
for the connection. The file "stk_comm.for" contains functions written to open up a socket and send a command to STK. Compaq Visual Fortran 6.6 was used to compile and run this.

Thanks to Paul Griesemer for submitting this when he was at the University of Texas.</description>
    </item>
    <item>
      <title>Various useful ODTK tasks</title>
      <link>http://adn.agi.com/downloadFile.cfm?typeId=8&amp;file=NiftyScriptingTricks.zip&amp;campaignId=283&amp;page=/codeExchange</link>
      <description>This collection of snippets shows how automate many useful or common tasks in ODTK, including:

1. Close all graphs open in the Static Product Builder
2. Add to filter tracker list
3. Add to tracking system tracker list
4. Load station position
5. Get finite maneuver name
6. Set facility MinElevation
7. Add impulsive maneuver
8. Add finite manuever
9. Add new element to a custom tracking schedule entry
10. Copy orbit from one sat to another
11. Set tracker measurement statistics
12. Load least squares stages
13. Convert state to Keplerian and return values
14. Refresh static product builder
15. Load observation file into scenario
16. Replace double quote character with a null
17. Open a text file and replace single quote character with double quote
18. List all files in a folder
19. List all files in a folder (alternate)
20. Kill orphaned processes in Task Manager
21. Insert selected measurement types in a filter or simulator
22. Set up orbit state
23. Load ODTK and set application properties
24. Load satellite list with 24 GPS satellites
25. Load reference clocks for composite clock estimation
26. Change facility coordinate systems
27. Change satellite coordinate systems
28. Convert single line to multiple lines, splitting on "))"
29. Add an extension to every file name in a folder

Thanks to Dick Hujsak for compiling this collection.</description>
    </item>
  </channel>
</rss>

