||CimEventList is an enumeration of CimEvent objects. The CimEventList is
returned from the CimProject.Events property. Existing
events can be retrieved and modified and new events can be added to
the CimEventList object.
' Attach to project
Dim project As CimProject
Set project = CreateObject("CimProject")
project.dynamicMode = False
Dim eventList As CimEventList
Set eventList = project.Events
' Create a new global event
Dim event1 As CimEvent
Set event1 = CreateObject("CimEvent")
event1.ID = "NEW_EVENT"
event1.Type = CimPointEquals
event1.PointID = "AAA"
event1.PointValue = "4325"
event1.Enabled = True
event1.AlarmOnOverFlow = True
event1.LogErrorOnOverFlow = False
event1.EventExecution = CimSequentialExecution
' Add event to event list
' Retrieve event from event list
Dim event2 As CimEvent
Set event2 = eventList.Item("NEW_EVENT")
event2.Type = CimAlarmGenerated
event2.AlarmID = "ALARM_BLOCK1"
event2.ResourceID = "$SYSTEM"
event2.ClassID = "ABLCK"
' Modify event in the event list
' Delete event from the event list
' Enumerate through each event in the event list
For Each event1 In eventList
MsgBox "Event Id =" &