AGI STK Objects 11 Send comments on this topic.
NewScenario Method (IAgStkObjectRoot)
See Also  Example
ScenarioName
The scenario name.





Description

Creates a new scenario. User must close a scenario before creating a new one; otherwise an exception will occur.

Syntax

[Visual Basic .NET]
Public Sub NewScenario( _
   ByVal ScenarioName As String _
) 

[C#]
public void NewScenario(
string ScenarioName
);

[Managed C++]
public: void NewScenario(
String __gc ^ ScenarioName
);

[Java]
public  newScenario(
String ScenarioName
);

[Unmanaged C++]
public: HRESULT NewScenario(
BSTR ScenarioName
);

Parameters

ScenarioName
The scenario name.

Example

Create a new scenario (closing the current scenario if necessary)
[C#] Copy Code
// Close current scenario 
if (root.CurrentScenario != null

    root.CloseScenario(); 

root.NewScenario("Scenario1"); 
 
// Get IAgScenario interface 
IAgScenario scenario = root.CurrentScenario as IAgScenario; 
 
// Set scenario start and stop times 
scenario.SetTimePeriod("1 Jun 1999 12:00:00.00""2 Jun 1999 12:00:00.00"); 
 

Create a new scenario (closing the current scenario if necessary)
[Visual Basic .NET] Copy Code
' Close current scenario
If root.CurrentScenario IsNot Nothing Then
    root.CloseScenario()
End If
root.NewScenario("Scenario1")

' Get IAgScenario interface
Dim scenario As IAgScenario = TryCast(root.CurrentScenario, IAgScenario)

' Set scenario start and stop times
scenario.SetTimePeriod("1 Jun 1999 12:00:00.00", "2 Jun 1999 12:00:00.00")

Create a new Scenario
[MATLAB] Copy Code
% IAgStkObjectRoot root: STK Object Model Root 
root.NewScenario('Example_Scenario'); 
 
 

See Also

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1