STK ObjectsSend comments on this topic.
New Method (IAgStkObjectCollection)
See Also
EClassType
InstName
The name of the Object. Will be shown in the Object Browser in STK.
Windows





Windows & Linux

Description

Creates an STK object using specified class and instance name.

Syntax

[Visual Basic .NET]
Public Function New( _
    ByVal EClassType As AgESTKObjectType, _
    ByVal InstName As String _
) As IAgStkObject
[Managed C++]
public: IAgStkObject^ New(
    AgESTKObjectType EClassType,
    String __gc ^ InstName
);
[Unmanaged C++]
public: HRESULT New(
    AgESTKObjectType EClassType,
    BSTR InstName,
    IAgStkObject ** ppRetVal
);
[Java]
public IAgStkObject new(
    AgESTKObjectType EClassType,
    String InstName
);
[Python - STK API ]
def New(self, EClassType:"AgESTKObjectType", InstName:str) -> "IAgStkObject":

Parameters

EClassType
InstName
The name of the Object. Will be shown in the Object Browser in STK.

See Also

Example

Create an area target (on the current scenario central body)
[C#]
// Create the AreaTarget on the current scenario central body (use
// NewOnCentralBody to specify explicitly the central body)
IAgAreaTarget areaTarget = root.CurrentScenario.Children.New(AgESTKObjectType.eAreaTarget, "MyAreaTarget") as IAgAreaTarget;
Create a chain (on the current scenario central body)
[C#]
// Create the Chain on the current scenario central body (use
// NewOnCentralBody to specify explicitly the central body)
IAgChain chain = root.CurrentScenario.Children.New(AgESTKObjectType.eChain, "MyChain") as IAgChain;
Add a new STK Object to the scenario
[C#]
root.CurrentScenario.Children.New(AgESTKObjectType.eShip, "Ship1");
Create an area target (on the current scenario central body)
[Visual Basic .NET]
' Create the AreaTarget on the current scenario central body (use
' NewOnCentralBody to specify explicitly the central body)
Dim areaTarget As IAgAreaTarget = TryCast(root.CurrentScenario.Children.[New](AgESTKObjectType.eAreaTarget, "MyAreaTarget"), IAgAreaTarget)
Create a chain (on the current scenario central body)
[Visual Basic .NET]
' Create the Chain on the current scenario central body (use
' NewOnCentralBody to specify explicitly the central body)
Dim chain As IAgChain = TryCast(root.CurrentScenario.Children.[New](AgESTKObjectType.eChain, "MyChain"), IAgChain)
Add a new STK Object to the scenario
[Visual Basic .NET]
root.CurrentScenario.Children.[New](AgESTKObjectType.eShip, "Ship1")
© 2024 Analytical Graphics, Inc. All Rights Reserved.