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





Description

Access Constraint Used for Third Body Obstructions.

Public Methods

Public Method AddObstruction Adds an Obstruction by Name
Public Method IsObstructionAssigned Helper method to see if a third body is already assigned
Public Method RemoveObstruction Remove an Obstruction by Name

Public Properties

Public Property AssignedObstructions Gets the Assigned Obstructions
Public Property AvailableObstructions Gets the Available Obstructions

Remarks

Note on Solar/Lunar Obstructions

Please note the following regarding the relationship between setting Solar/Lunar in the GUI and in this Object Model:

If you select the Solar/Lunar Obstruction checkbox on the Sun Constraints page, it sets both the Sun and the Moon as obstructions. If you then want to remove one or both of these obstructions in the Object Model, you must use the RemoveObstruction method twice, i.e., once for each body.

Similarly, to set the Sun and the Moon as obstructions in the Object Model, you must use the AddObstruction method twice.

Interfaces

Implemented Interface
IAgAccessConstraint

Example

Add and configure a third body obstruction access constraint
[C#] Copy Code
// Get IAgAccessCnstrThirdBody interface 
IAgAccessCnstrThirdBody thirdBodyConstraint = accessconstraints.AddConstraint(AgEAccessConstraints.eCstrThirdBodyObstruction) as IAgAccessCnstrThirdBody; 
 
// AvailableObstructions returns a one dimensional array of obstruction paths 
Array availableArray = thirdBodyConstraint.AvailableObstructions; 
 
// In this example add all available obstructions 
Console.WriteLine("Available obstructions"); 
foreach (string available in availableArray) 

    Console.WriteLine(available); 
    thirdBodyConstraint.AddObstruction(available); 

 
// AssignedObstructions returns a one dimensional array of obstruction paths 
Array assignedArray = thirdBodyConstraint.AssignedObstructions; 
 
Console.WriteLine("Assigned obstructions"); 
foreach (string assigned in assignedArray) 

    Console.WriteLine(assigned); 

 

Add and configure a third body obstruction access constraint
[Visual Basic .NET] Copy Code
' Get IAgAccessCnstrThirdBody interface
Dim thirdBodyConstraint As IAgAccessCnstrThirdBody = TryCast(accessconstraints.AddConstraint(AgEAccessConstraints.eCstrThirdBodyObstruction), IAgAccessCnstrThirdBody)

' AvailableObstructions returns a one dimensional array of obstruction paths
Dim availableArray As Array = thirdBodyConstraint.AvailableObstructions

' In this example add all available obstructions
Console.WriteLine("Available obstructions")
For Each available As String In availableArray
    Console.WriteLine(available)
    thirdBodyConstraint.AddObstruction(available)
Next

' AssignedObstructions returns a one dimensional array of obstruction paths
Dim assignedArray As Array = thirdBodyConstraint.AssignedObstructions

Console.WriteLine("Assigned obstructions")
For Each assigned As String In assignedArray
    Console.WriteLine(assigned)
Next

CoClasses that Implement IAgAccessCnstrThirdBody

© 2016 Analytical Graphics, Inc. All Rights Reserved.

STK Programming Interface 11.0.1