STK ObjectsSend comments on this topic.
IAgAccessCnstrAWBCollection Interface

Description

IAgAccessCnstrAWBCollection used to access angle, vector and condition constraint List interface.

Public Methods

Public Method AddConstraintAdds a constraint to the AWB Constraint Collection.
Public Method GetAvailableReferencesReturns an array of available References.
Public Method RemoveAllRemoves all items from the collection.
Public Method RemoveConstraintRemoves a Analysis Workbench using Reference/Component.
Public Method RemoveIndexRemoves an item given an index.

Public Properties

Public Property CountNumber of items in the collection.
Public Property ItemGet an IAgAccessCnstrAWB interface using an index.

Interfaces

Implemented Interface
IAgAccessConstraint

CoClasses that Implement IAgAccessCnstrAWBCollection

Example

Add multiple analysis workbench access constraints of the same type to an STK Object
[C#]
IAgAccessConstraintCollection accessConstraints = stkobject.AccessConstraints;
IAgAccessCnstrAWBCollection awbAccessConstraints = accessConstraints.AWBConstraints;

// Add constraints
string objectPath = stkobject.ClassName + "/" + stkobject.InstanceName;
IAgAccessCnstrAWB awbConst = awbAccessConstraints.AddConstraint(AgEAWBAccessConstraints.eCstrAWBVectorMag, objectPath + " East Vector") as IAgAccessCnstrAWB;
awbConst.EnableMin = true;
awbConst.Min = 0.0;

IAgAccessCnstrAWB awbConst2 = awbAccessConstraints.AddConstraint(AgEAWBAccessConstraints.eCstrAWBVectorMag, objectPath + " North Vector") as IAgAccessCnstrAWB;
awbConst2.EnableMax = true;
awbConst2.Max = 1000.0;
Remove analysis workbench access constraint
[C#]
IAgAccessConstraintCollection accessConstraints = stkobject.AccessConstraints;
IAgAccessCnstrAWBCollection awbAccessConstraints = accessConstraints.AWBConstraints;

string objectPath = stkobject.ClassName + "/" + stkobject.InstanceName;
awbAccessConstraints.RemoveConstraint(AgEAWBAccessConstraints.eCstrAWBVectorMag, objectPath + " East Vector");
List all available references for analysis workbench access constraint type
[C#]
IAgAccessCnstrAWBCollection awbaccessconstraints = stkobject.AccessConstraints.AWBConstraints;
foreach (string availableReference in awbaccessconstraints.GetAvailableReferences(AgEAWBAccessConstraints.eCstrAWBAngle) )
{
    Console.WriteLine("Available Reference: {0}", availableReference);
}
Add analysis workbench access constraint from analysis workbanch component
[C#]
if (stkobject.Vgt.Vectors.Contains("East"))
{
    IAgCrdnVector vec = stkobject.Vgt.Vectors["East"];
    IAgCrdn crdnVec = vec as IAgCrdn;

    IAgAccessConstraintCollection accessConstraints = stkobject.AccessConstraints;
    IAgAccessCnstrAWBCollection awbAccessConstraints = accessConstraints.AWBConstraints;

    IAgAccessCnstrAWB awbConst = awbAccessConstraints.AddConstraint(AgEAWBAccessConstraints.eCstrAWBVectorMag, crdnVec.QualifiedPath) as IAgAccessCnstrAWB;
    awbConst.EnableMin = true;
    awbConst.Min = 0.0;
    awbConst.EnableMax = true;
    awbConst.Max = 1000.0;

}
Add multiple analysis workbench access constraints of the same type to an STK Object
[Visual Basic .NET]
Dim accessConstraints As IAgAccessConstraintCollection = stkobject.AccessConstraints
Dim awbAccessConstraints As IAgAccessCnstrAWBCollection = accessConstraints.AWBConstraints

' Add constraints
Dim objectPath As String = stkobject.ClassName + "/" + stkobject.InstanceName
Dim awbConst As IAgAccessCnstrAWB = TryCast(awbAccessConstraints.AddConstraint(AgEAWBAccessConstraints.eCstrAWBVectorMag, objectPath + " East Vector"), IAgAccessCnstrAWB)
awbConst.EnableMin = True
awbConst.Min = 0

Dim awbConst2 As IAgAccessCnstrAWB = TryCast(awbAccessConstraints.AddConstraint(AgEAWBAccessConstraints.eCstrAWBVectorMag, objectPath + " North Vector"), IAgAccessCnstrAWB)
awbConst2.EnableMax = True
awbConst2.Max = 1000
Remove analysis workbench access constraint
[Visual Basic .NET]
Dim accessConstraints As IAgAccessConstraintCollection = stkobject.AccessConstraints
Dim awbAccessConstraints As IAgAccessCnstrAWBCollection = accessConstraints.AWBConstraints

Dim objectPath As String = stkobject.ClassName + "/" + stkobject.InstanceName
awbAccessConstraints.RemoveConstraint(AgEAWBAccessConstraints.eCstrAWBVectorMag, objectPath + " East Vector")
List all available references for analysis workbench access constraint type
[Visual Basic .NET]
Dim awbaccessconstraints As IAgAccessCnstrAWBCollection = stkobject.AccessConstraints.AWBConstraints
For Each availableReference As String In awbaccessconstraints.GetAvailableReferences(AgEAWBAccessConstraints.eCstrAWBAngle)
	Console.WriteLine("Available Reference: {0}", availableReference)
Next
Add analysis workbench access constraint from analysis workbanch component
[Visual Basic .NET]
If stkobject.Vgt.Vectors.Contains("East") Then
	Dim vec As IAgCrdnVector = stkobject.Vgt.Vectors("East")
	Dim crdnVec As IAgCrdn = TryCast(vec, IAgCrdn)

	Dim accessConstraints As IAgAccessConstraintCollection = stkobject.AccessConstraints
	Dim awbAccessConstraints As IAgAccessCnstrAWBCollection = accessConstraints.AWBConstraints

	Dim awbConst As IAgAccessCnstrAWB = TryCast(awbAccessConstraints.AddConstraint(AgEAWBAccessConstraints.eCstrAWBVectorMag, crdnVec.QualifiedPath), IAgAccessCnstrAWB)
	awbConst.EnableMin = True
	awbConst.Min = 0
	awbConst.EnableMax = True

	awbConst.Max = 1000
End If
© 2024 Analytical Graphics, Inc. All Rights Reserved.