AGI STK Objects 11 Send comments on this topic.
IAgTerrainCollection Collection





Description

IAgTerrainCollection lists all the terrain data files available in this scenario for visualization and analysis.

Object Model

Public Methods

Public Method Add Adds a terrain item to the collection.
Public Method Remove Removes a given index from the collection.
Public Method RemoveAll Removes all items from the collections.

Public Properties

Public Property Count The number of items in the collection.
Public Property Item Given an index, returns an IAgTerrain interface.

Example

Add analytical terrain to the scenario on Earth central body
[C#] Copy Code
// Retrieve the IAgScenario interface 
IAgScenario scenario = root.CurrentScenario as IAgScenario; 
 
IAgCentralBodyTerrainCollection terrainCollection = scenario.Terrain; 
IAgTerrainCollection elementCollection = terrainCollection["Earth"].TerrainCollection; 
 
// Add terrain data file to current scenario's terrain collection 
// Terrain data files traditionally have .dte extensions 
IAgTerrain terrain = elementCollection.Add(terrainFile, AgETerrainFileType.eMUSERasterFile); 
 
// Set Scenario to use terrain data file 
terrain.UseTerrain = true
 

Add analytical terrain to the scenario on Earth central body
[Visual Basic .NET] Copy Code
' Retrieve the IAgScenario interface
Dim scenario As IAgScenario = TryCast(root.CurrentScenario, IAgScenario)

Dim terrainCollection As IAgCentralBodyTerrainCollection = scenario.Terrain
Dim elementCollection As IAgTerrainCollection = terrainCollection("Earth").TerrainCollection

' Add terrain data file to current scenario's terrain collection
' Terrain data files traditionally have .dte extensions
Dim terrain As IAgTerrain = elementCollection.Add(terrainFile, AgETerrainFileType.eMUSERasterFile)

' Set Scenario to use terrain data file
terrain.UseTerrain = True

Add Terrain for Analysis
[MATLAB] Copy Code
%IAgStkObjectRoot root: STK Object Model Root 
terrain = root.CurrentScenario.Terrain.Item('Earth').TerrainCollection.Add('C:\Program Files\AGI\STK 11\Help\stktraining\samples\SRTM_Skopje.pdtt','ePDTTTerrainFile'); 
terrain.UseTerrain = true; 
 
 
© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1