AGI STK VGT 11 Send comments on this topic.
CreateEventTimeOffset Method (IAgCrdnEventFactory)
See Also  Example
Name
Description





Description

Creates an event at fixed offset from specified reference event.

Syntax

[Visual Basic .NET]
Public Function CreateEventTimeOffset( _
   ByVal Name As String, _
   ByVal Description As String _
) As IAgCrdnEvent

[C#]
public IAgCrdnEvent CreateEventTimeOffset(
string Name,
string Description
);

[Managed C++]
public: IAgCrdnEvent^ CreateEventTimeOffset(
String __gc ^ Name,
String __gc ^ Description
);

[Java]
public IAgCrdnEvent createEventTimeOffset(
String Name,
String Description
);

[Unmanaged C++]
public: HRESULT CreateEventTimeOffset(
BSTR Name,
BSTR Description,
IAgCrdnEvent ** ReturnValue
);

Parameters

Name
Description

Remarks

Spaces and most punctuation ( except for "-_().") cannot be used as a part of a component name when creating new components via VGT API.

Example

Create and configure fixed time offset event.
[C#] Copy Code
IAgCrdnEvent timeEvent = provider.Events.Factory.CreateEventTimeOffset("MyEventTimeOffset""MyDescription"); 
IAgCrdnEventTimeOffset asTimeOffset = timeEvent as IAgCrdnEventTimeOffset; 
 
asTimeOffset.ReferenceTimeInstant = provider.Events["AvailabilityStartTime"]; 
 
// Uses current Time unit preference, this code snippet assumes seconds. 
asTimeOffset.TimeOffset = 3
 
IAgCrdnEventFindOccurrenceResult occurrence = timeEvent.FindOccurrence(); 
if (occurrence.IsValid) 

    Console.WriteLine("Event occurred at: " + occurrence.Epoch); 

 

Create and configure fixed time offset event.
[Visual Basic .NET] Copy Code
Dim timeEvent As IAgCrdnEvent = provider.Events.Factory.CreateEventTimeOffset("MyEventTimeOffset", "MyDescription")
Dim asTimeOffset As IAgCrdnEventTimeOffset = TryCast(timeEvent, IAgCrdnEventTimeOffset)

asTimeOffset.ReferenceTimeInstant = provider.Events("AvailabilityStartTime")

' Uses current Time unit preference, this code snippet assumes seconds.
asTimeOffset.TimeOffset = 3

Dim occurrence As IAgCrdnEventFindOccurrenceResult = timeEvent.FindOccurrence()
If occurrence.IsValid Then
    Console.WriteLine("Event occurred at: " + occurrence.Epoch)
End If

See Also

© 2016 All Rights Reserved.

STK Programming Interface 11.0.1