STK ObjectsSend comments on this topic.
AddConstraint Method (IAgAccessCnstrAWBCollection)
See Also
EConstraint
Reference
Windows





Windows & Linux

Description

Adds a constraint to the AWB Constraint Collection.

Syntax

[Visual Basic .NET]
Public Function AddConstraint( _
    ByVal EConstraint As AgEAWBAccessConstraints, _
    ByVal Reference As String _
) As IAgAccessConstraint
[Managed C++]
public: IAgAccessConstraint^ AddConstraint(
    AgEAWBAccessConstraints EConstraint,
    String __gc ^ Reference
);
[Unmanaged C++]
public: HRESULT AddConstraint(
    AgEAWBAccessConstraints EConstraint,
    BSTR Reference,
    IAgAccessConstraint ** ppIAgAccessConstraint
);
[Java]
public IAgAccessConstraint addConstraint(
    AgEAWBAccessConstraints EConstraint,
    String Reference
);
[Python - STK API ]
def AddConstraint(self, EConstraint:"AgEAWBAccessConstraints", Reference:str) -> "IAgAccessConstraint":

Parameters

EConstraint
Reference

See Also

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;
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
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.