STK ObjectsSend comments on this topic.
IAgAccessCnstrThirdBody Interface

Description

Access Constraint Used for Third Body Obstructions.

Public Methods

Public Method AddObstructionAdds an Obstruction by Name
Public Method IsObstructionAssignedHelper method to see if a third body is already assigned
Public Method RemoveObstructionRemove an Obstruction by Name

Public Properties

Public Property AssignedObstructionsGets the Assigned Obstructions
Public Property AvailableObstructionsGets 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

CoClasses that Implement IAgAccessCnstrThirdBody

Example

Add and configure a third body obstruction access constraint
[C#]
// 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]
' 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
© 2024 Analytical Graphics, Inc. All Rights Reserved.