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 _
)
|
| [Managed C++] |
|---|
public: void NewScenario(
String __gc ^ ScenarioName
);
|
| [Unmanaged C++] |
|---|
public: HRESULT NewScenario(
BSTR ScenarioName
);
|
[Python - STK API ] |
|---|
def NewScenario(self, ScenarioName:str) -> None:
|
Parameters
See Also
Example
Create a new scenario (closing the current scenario if necessary)
| [C#] |
|---|
// 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] |
|---|
' 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] |
|---|
% IAgStkObjectRoot root: STK Object Model Root
root.NewScenario('Example_Scenario');
|
|