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





Description

IAgScenario Interface for Scenario-level properties.

Object Model













Public Methods

Public Method GetAccessBetweenObjectsByPath Returns the access object currently associated with the two STK objects specified using their paths. The paths can be fully-qualified or truncated.
Public Method GetExistingAccesses Returns an array of existing accesses in the current scenario. The result is a two-dimensional array of triplets where each triplet contains the paths of two objects participating in the access and a flag indicating whether the access is computed.
Public Method SetDirty Sets the flag indicating the scenario has been modified.
Public Method SetTimePeriod Method to set the Scenario time period. startTime/stopTime use DateFormat Dimension.

Public Properties

Public Property AcWGS84Warning Specify when to display the aircraft mission modeler WGS84 warning.
Public Property AnalysisEpoch Allows the user to configure the scenario's analysis epoch.
Public Property AnalysisInterval Allows the user to configure the scenario's analysis time period.
Public Property Animation Scenario animation settings.
Public Property ComponentDirectory The component directory interface
Public Property EarthData Scenario Earth Data settings.
Public Property Epoch Scenario epoch. Uses DateFormat Dimension.
Public Property GenDbs Scenario database settings.
Public Property Graphics Scenario 2D Graphics settings.
Public Property IsDirty Specify whether scenario needs to be saved
Public Property MslNoOrbitWarning Specify whether to display a warning when a missile trajectory does not impact the central body.
Public Property MslStopTimeWarning Generate a message that warns the user if the missile achieves orbit (and give the perigee) or impacts the surface (and give the interval after missile's stop time).
Public Property RadarClutterMap Returns the global radar clutter map.
Public Property RadarCrossSection Returns the global radar cross section.
Public Property RFEnvironment Returns the RF environment.
Public Property SatNoOrbitWarning Specify whether to display a warning when a satellite orbit intersects the central body.
Public Property ScenarioFiles Returns list of scenario files.
Public Property SceneManager A scene manager.
Public Property SpaceEnvironment Scenario SpaceEnvironment settings.
Public Property StartTime Scenario start time. Uses DateFormat Dimension.
Public Property StopTime Scenario stop time. Uses DateFormat Dimension.
Public Property Terrain Returns a list of central bodies and their terrains.
Public Property UseAnalysisStartTimeForEpoch Whether the scenario Epoch is the same as the scenario's StartTime.
Public Property VO Scenario 3D Graphics settings.

Example

GetAccessBetweenObjectsByPath using the output of GetExistingAccesses
[C#] Copy Code
IAgScenario scenario = stkRoot.CurrentScenario as IAgScenario; 
Array accesses = scenario.GetExistingAccesses(); 
 
int numAccesses = accesses.GetLength(0);  // number of accesses 
 
string object1 = accesses.GetValue(00).ToString();    // e.g. "Facility/Fac1" 
string object2 = accesses.GetValue(01).ToString();    // e.g. "Satellite/Sat1" 
bool computed = (bool)accesses.GetValue(02);          // e.g. true  (if access has been computed) 
 
IAgStkAccess access = scenario.GetAccessBetweenObjectsByPath(object1, object2); 
 

Configure scenario text font
[C#] Copy Code
IAgSc3dFont fonts = scenario.VO.LargeFont; 
 
fonts.Bold = true
fonts.Italic = true
fonts.PtSize = AgESc3dPtSize.eSc3dFontSize36; 
 
if (fonts.IsFontAvailable("Impact")) 

    fonts.Name = "Impact"

 
// AvailableFonts returns a one dimensional array of font strings 
Array allFonts = fonts.AvailableFonts; 
int index = Array.IndexOf(allFonts, "Courier"); 
if (index != -1

    fonts.Name = allFonts.GetValue(index) as string

 

Sets the scenario analysis time to the empheris time of another object.
[C#] Copy Code
IAgSatellite satellite = stkRoot.GetObjectFromPath("/Satellite/GeoEye"as IAgSatellite; 
 
IAgCrdnProvider vgtProvider = stkRoot.VgtRoot.GetProvider("/Satellite/GeoEye"); 
IAgVePropagatorTwoBody twoBody = satellite.Propagator as IAgVePropagatorTwoBody; 
IAgCrdnEventSmartEpoch startEpoch = twoBody.EphemerisInterval.GetStartEpoch(); 
IAgCrdnEventSmartEpoch stopEpoch = twoBody.EphemerisInterval.GetStopEpoch(); 
 
scenario.AnalysisInterval.SetStartAndStopEpochs(startEpoch, stopEpoch); 
 

Sets the scenario analysis time to today and the duration to one day.
[C#] Copy Code
scenario.AnalysisInterval.SetStartTimeAndDuration("Today""+1 Day"); 
 

GetAccessBetweenObjectsByPath using the output of GetExistingAccesses
[Visual Basic .NET] Copy Code
Dim scenario As IAgScenario = TryCast(stkRoot.CurrentScenario, IAgScenario)
Dim accesses As Array = scenario.GetExistingAccesses()

Dim numAccesses As Integer = accesses.GetLength(0)
' number of accesses
Dim object1 As String = accesses.GetValue(0, 0).ToString()
' e.g. "Facility/Fac1"
Dim object2 As String = accesses.GetValue(0, 1).ToString()
' e.g. "Satellite/Sat1"
Dim computed As Boolean = DirectCast(accesses.GetValue(0, 2), Boolean)
' e.g. true (if access has been computed)
Dim access As IAgStkAccess = scenario.GetAccessBetweenObjectsByPath(object1, object2)

Configure scenario text font
[Visual Basic .NET] Copy Code
Dim fonts As IAgSc3dFont = scenario.VO.LargeFont

fonts.Bold = True
fonts.Italic = True
fonts.PtSize = AgESc3dPtSize.eSc3dFontSize36

If fonts.IsFontAvailable("Impact") Then
    fonts.Name = "Impact"
End If

' AvailableFonts returns a one dimensional array of font strings
Dim allFonts As Array = fonts.AvailableFonts
Dim index As Integer = Array.IndexOf(allFonts, "Courier")
If index <> -1 Then
    fonts.Name = TryCast(allFonts.GetValue(index), String)
End If

Sets the scenario analysis time to the empheris time of another object.
[Visual Basic .NET] Copy Code
Dim satellite As IAgSatellite = TryCast(stkRoot.GetObjectFromPath("/Satellite/GeoEye"), IAgSatellite)

Dim vgtProvider As IAgCrdnProvider = stkRoot.VgtRoot.GetProvider("/Satellite/GeoEye")
Dim twoBody As IAgVePropagatorTwoBody = TryCast(satellite.Propagator, IAgVePropagatorTwoBody)
Dim startEpoch As IAgCrdnEventSmartEpoch = twoBody.EphemerisInterval.GetStartEpoch()
Dim stopEpoch As IAgCrdnEventSmartEpoch = twoBody.EphemerisInterval.GetStopEpoch()

scenario.AnalysisInterval.SetStartAndStopEpochs(startEpoch, stopEpoch)

Sets the scenario analysis time to today and the duration to one day.
[Visual Basic .NET] Copy Code
scenario.AnalysisInterval.SetStartTimeAndDuration("Today", "+1 Day")

Change scenario time period
[MATLAB] Copy Code
% IAgStkObjectRoot root: STK Object Model Root 
root.CurrentScenario.SetTimePeriod('30 Jul 2014 16:00:05.000', '31 Jul 2014 16:00:00.000'); 
root.CurrentScenario.Epoch = '30 Jul 2014 16:00:05.000'; 
 
 

CoClasses that Implement IAgScenario

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

STK Programming Interface 11.0.1