STK Vector Geometry ToolSend comments on this topic.
OccursBefore Method (IAgCrdnEvent)
See Also
Epoch
A time specified in seconds since scenario epoch.
Windows





Windows & Linux

Description

Return true if computed time instance occurs before or at specified time, return false otherwise.

Syntax

[Visual Basic .NET]
Public Function OccursBefore( _
    ByVal Epoch As System.Object _
) As Boolean
[C#]
public bool OccursBefore(
    System.Object Epoch
);
[Managed C++]
public: bool OccursBefore(
    VARIANT Epoch
);
[Unmanaged C++]
public: HRESULT OccursBefore(
    VARIANT Epoch,
    VARIANT_BOOL * pRetVal
);
[Java]
public bool occursBefore(
    AgVariant Epoch
);
[Python - STK API ]
def OccursBefore(self, Epoch:typing.Any) -> bool:

Parameters

Epoch
A time specified in seconds since scenario epoch.

See Also

Example

Determine if event occurs before an epoch.
[C#]
// The event you are interested in.
IAgCrdnEvent timeEvent1 = provider.Events["GroundTrajectory.Detic.LLA.Altitude.TimeOfMax"];

// The reference event you want to determine if event of interest happened before.
IAgCrdnEvent timeEvent2 = provider.Events["GroundTrajectory.Detic.LLA.Altitude.TimeOfMin"];
IAgCrdnEventFindOccurrenceResult occurrence2 = timeEvent2.FindOccurrence();

if (occurrence2.IsValid)
{
    if (timeEvent1.OccursBefore(occurrence2.Epoch))
    {
        Console.WriteLine("The time of maximum altitude happend before time of minimum altitude");
    }
    else
    {
        Console.WriteLine("The time of minimum altitude happend before time of maximum altitude");
    }
}
Determine if event occurs before an epoch.
[Visual Basic .NET]
' The event you are interested in.
Dim timeEvent1 As IAgCrdnEvent = provider.Events("GroundTrajectory.Detic.LLA.Altitude.TimeOfMax")

' The reference event you want to determine if event of interest happened before.
Dim timeEvent2 As IAgCrdnEvent = provider.Events("GroundTrajectory.Detic.LLA.Altitude.TimeOfMin")
Dim occurrence2 As IAgCrdnEventFindOccurrenceResult = timeEvent2.FindOccurrence()

If occurrence2.IsValid Then
	If timeEvent1.OccursBefore(occurrence2.Epoch) Then
		Console.WriteLine("The time of maximum altitude happend before time of minimum altitude")
	Else
		Console.WriteLine("The time of minimum altitude happend before time of maximum altitude")
	End If
End If
© 2024 Analytical Graphics, Inc. All Rights Reserved.