STK ObjectsSend comments on this topic.
NewScenario Method (IAgStkObjectRoot)
See Also
ScenarioName
The scenario name.
Windows





Windows & Linux

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
);
[Unmanaged C++]
public: HRESULT NewScenario(
    BSTR ScenarioName
);
[Java]
public void newScenario(
    String ScenarioName
);
[Python - STK API ]
def NewScenario(self, ScenarioName:str) -> None:

Parameters

ScenarioName
The scenario name.

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
[Python - STK API]
# IAgStkObjectRoot root: STK Object Model Root
root.NewScenario('Example_Scenario')

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


        
© 2024 Analytical Graphics, Inc. All Rights Reserved.