AGI STK Objects 11 Send comments on this topic.
IAgAccessConstraintCollection Collection
Windows






Windows & Linux

Description

AgAccessConstraintCollection used to access the list of constraints

Object Model

Public Methods

Public Method AddConstraintAdds a constraint to the Constraint Collection.


To determine the interface to use for a specific constraint, scroll down to the EConstraint Parameter table near the bottom of this help page. This table lists all possible values for the AgEAccessConstraints enumeration. The description column provides the corresponding interface to use with each constraint. For example, IAgAccessCnstrMinMax is the interface used with the Range constraint, eCstrRange.


Code snippet examples that show how to add and configure constraints are provided at the bottom of this help page.


The eCstrApparentTime, eCstrDuration, eCstrGMT, eCstrIntervals, eCstrLocalTime constraint types can be added multiple times to the constraint collection.

Public Method AddNamedConstraintAdds a constraint with the given name to the collection.
Public Method AvailableConstraintsReturns a rectangular two-dimensional array of available constraints. A row of the array consists of two elements where the first element is a symbolic name of the constraint and the second is a corresponding enumeration value.
Public Method GetActiveConstraintRetrieves the active constraint.
Public Method GetActiveNamedConstraintRetrieves an active constraint with the given name.
Public Method IsConstraintActiveGiven an AgEAccessConstraints enum, informs the user if the constraint is active.
Public Method IsConstraintSupportedIs the constraint supported for this object.
Public Method IsNamedConstraintActiveGiven a constraint name, returns whether the specified constraint is active.
Public Method IsNamedConstraintSupportedIs the named constraint supported for this object.
Public Method RemoveConstraintRemoves a constraint from the collection.
Public Method RemoveNamedConstraintRemoves a constraint with the given name from the collection.

Public Properties

Public Property AWBConstraintsReturns a AgAccessCnstrAWBCollection constraint used to access angle, vector and condition constraint.
Public Property Countproperty Count returns the size of the collection
Public Property Itemproperty Item returns an AccessConstraint

Example

Add and configure a sun elevation angle access constraint
[C#]Copy Code
IAgAccessCnstrMinMax minmax = accessConstraints.AddConstraint(AgEAccessConstraints.eCstrSunElevationAngle) as IAgAccessCnstrMinMax; 
minmax.EnableMin = true
minmax.Min = 22.2
minmax.EnableMax = true
minmax.Max = 77.7
 

Add and configure a lunar elevation angle access constraint
[C#]Copy Code
IAgAccessCnstrMinMax minmax = accessConstraints.AddConstraint(AgEAccessConstraints.eCstrLunarElevationAngle) as IAgAccessCnstrMinMax; 
minmax.EnableMin = true
minmax.Min = 11.1
minmax.EnableMax = true
minmax.Max = 88.8
 

Add and configure a LOS sun exclusion access constraint
[C#]Copy Code
// Angle constraint 
IAgAccessCnstrAngle cnstrAngle = accessConstraints.AddConstraint(AgEAccessConstraints.eCstrLOSSunExclusion) as IAgAccessCnstrAngle; 
cnstrAngle.Angle = 176.0
 

Add and configure a lighting condition access constraint
[C#]Copy Code
// Condition constraint 
IAgAccessCnstrCondition light = accessConstraints.AddConstraint(AgEAccessConstraints.eCstrLighting) as IAgAccessCnstrCondition; 
light.Condition = AgECnstrLighting.eDirectSun; 
 

Add and configure an altitude access constraint
[C#]Copy Code
// Attitude constraint 
IAgAccessCnstrMinMax altitude = accessConstraints.AddConstraint(AgEAccessConstraints.eCstrAltitude) as IAgAccessCnstrMinMax; 
altitude.EnableMin = true
altitude.Min = 20.5
 

List all exclusion zones of an access constraint
[C#]Copy Code
IAgAccessCnstrExclZonesCollection excZones = accessconstraints.GetActiveConstraint(AgEAccessConstraints.eCstrExclusionZone) as IAgAccessCnstrExclZonesCollection; 
 
if (excZones != null

    // ToArray returns a two dimensional array 
    // The second dimension is an array of minLon, minLat, maxLon, maxLat values 
    Array zones = excZones.ToArray(0, -1); 
 
    for (int i = 0; i < zones.GetUpperBound(0); i++) 
    { 
        Console.WriteLine("MinLon: {0}, MinLat: {1}, MaxLon: {2}, MaxLat {3}", zones.GetValue(i, 0), zones.GetValue(i, 1), zones.GetValue(i, 2), zones.GetValue(i, 3)); 
    } 

 

Enumerate the available constraints collection
[C#]Copy Code
// The AvailableConstraints method returns a rectangular two-dimensional array of available constraints. 
// A row of the array consists of two elements where the first element is a symbolic name of the constraint, 
// and the second is a corresponding enumeration value. 
 
Array arAvailable = accessConstraints.AvailableConstraints(); 
for (int i = 0; i < arAvailable.GetLength(0); i++) 

    string availName = (string)arAvailable.GetValue(i, 0); 
    AgEAccessConstraints eAccessConstraint = (AgEAccessConstraints)(int)arAvailable.GetValue(i, 1); 
    Console.WriteLine("\tConstraint {0}: {1} ({2})", i, availName, eAccessConstraint); 

 

Add and configure a sun elevation angle access constraint
[Visual Basic .NET]Copy Code
Dim minmax As IAgAccessCnstrMinMax = TryCast(accessConstraints.AddConstraint(AgEAccessConstraints.eCstrSunElevationAngle), IAgAccessCnstrMinMax)
minmax.EnableMin = True
minmax.Min = 22.2
minmax.EnableMax = True
minmax.Max = 77.7

Add and configure a lunar elevation angle access constraint
[Visual Basic .NET]Copy Code
Dim minmax As IAgAccessCnstrMinMax = TryCast(accessConstraints.AddConstraint(AgEAccessConstraints.eCstrLunarElevationAngle), IAgAccessCnstrMinMax)
minmax.EnableMin = True
minmax.Min = 11.1
minmax.EnableMax = True
minmax.Max = 88.8

Add and configure a LOS sun exclusion access constraint
[Visual Basic .NET]Copy Code
' Angle constraint
Dim cnstrAngle As IAgAccessCnstrAngle = TryCast(accessConstraints.AddConstraint(AgEAccessConstraints.eCstrLOSSunExclusion), IAgAccessCnstrAngle)
cnstrAngle.Angle = 176

Add and configure a lighting condition access constraint
[Visual Basic .NET]Copy Code
' Condition constraint
Dim light As IAgAccessCnstrCondition = TryCast(accessConstraints.AddConstraint(AgEAccessConstraints.eCstrLighting), IAgAccessCnstrCondition)
light.Condition = AgECnstrLighting.eDirectSun

Add and configure an altitude access constraint
[Visual Basic .NET]Copy Code
' Attitude constraint
Dim altitude As IAgAccessCnstrMinMax = TryCast(accessConstraints.AddConstraint(AgEAccessConstraints.eCstrAltitude), IAgAccessCnstrMinMax)
altitude.EnableMin = True
altitude.Min = 20.5

List all exclusion zones of an access constraint
[Visual Basic .NET]Copy Code
Dim excZones As IAgAccessCnstrExclZonesCollection = TryCast(accessconstraints.GetActiveConstraint(AgEAccessConstraints.eCstrExclusionZone), IAgAccessCnstrExclZonesCollection)

If excZones IsNot Nothing Then
    ' ToArray returns a two dimensional array
    ' The second dimension is an array of minLon, minLat, maxLon, maxLat values
    Dim zones As Array = excZones.ToArray(0, -1)

    Dim i As Integer = 0
    While i <>
        Console.WriteLine("MinLon: {0}, MinLat: {1}, MaxLon: {2}, MaxLat {3}", zones.GetValue(i, 0), zones.GetValue(i, 1), zones.GetValue(i, 2), zones.GetValue(i, 3))
        System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
    End While
End If

Enumerate the available constraints collection
[Visual Basic .NET]Copy Code
' The AvailableConstraints method returns a rectangular two-dimensional array of available constraints.
' A row of the array consists of two elements where the first element is a symbolic name of the constraint,
' and the second is a corresponding enumeration value.

Dim arAvailable As Array = accessConstraints.AvailableConstraints()
Dim i As Integer = 0
While i <>
    Dim availName As String = DirectCast(arAvailable.GetValue(i, 0), String)
    Dim eAccessConstraint As AgEAccessConstraints = DirectCast(DirectCast(arAvailable.GetValue(i, 1), Integer), AgEAccessConstraints)
    Console.WriteLine(vbTab & "Constraint {0}: {1} ({2})", i, availName, eAccessConstraint)
    System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While

Get handle to the object access constraints
[MATLAB]Copy Code
% IAgSatellite satellite: Satellite object 
accessConstraints = satellite.AccessConstraints; 
 
 
Get handle to the object access constraints
[Python]Copy Code
# IAgSatellite satellite: Satellite object 
accessConstraints = satellite.AccessConstraints 
 
 
© 2018 Analytical Graphics, Inc. All Rights Reserved.