Hi,
what are you trying to do?
Did you take a look on the Alarm Message List Filter picture type?
If this does not fulfill your requirements, there is the possibility to use the filter of a picture switch function to the Alarm Message List Picture in VBA/VSTA.
You have to create a picture switch function to your alarm picture in the Editor (in my example "dummyfilter", see code below), where you can set some predefined settings. This settings can be manipulated via VBA/VSTA in the Runtime via the DynProperties of the function (also see code below).
//Function to get the filtered alarms
public void Macro_GetFilteredAlarmItems()
{
zenOn.IAlarm zAML;
zenOn.IAlarmItems zAML_Items;
zenOn.IAlarmItem zAML_Item;
Int32 i;
string[] DynProps;
zAML = this.Alarm();
//Show PictFilter DynProperties - Debug (DynProperties can also be shown via XML - Exporting the Function)
DynProps = (string[])this.RtFunctions().Item("dummyfilter").get_DynPropertiesEnum("PictFilter");
foreach (string s in DynProps)
{
System.Diagnostics.Debug.WriteLine(s);
}
//Manipulate the function (here the VarFilter is set to "ivar2")
this.RtFunctions().Item("dummyfilter").set_DynProperties("PictFilter[0].VarFilter", "ivar2");
//Apply the alarm filter
zAML_Items = zAML.AlarmItems("dummyfilter");
//iterate through the filtered alarms
for (i = 0; i < zAML_Items.Count; i++)
{
zAML_Item = zAML_Items.Item(i);
PrintAlarm(zAML_Item);
}
}
//Function for printing the alarm information
public void PrintAlarm(zenOn.IAlarmItem myAlarmItem)
{
System.Diagnostics.Debug.WriteLine("Comes " + myAlarmItem.Timecomes + "\r\n");
System.Diagnostics.Debug.WriteLine("Goes " + myAlarmItem.Timegoes + "\r\n");
System.Diagnostics.Debug.WriteLine("Ack " + myAlarmItem.Timequitted + "\r\n");
System.Diagnostics.Debug.WriteLine("Text " + myAlarmItem.Text + "\r\n");
System.Diagnostics.Debug.WriteLine("Variable " + myAlarmItem.Name + "\r\n");
System.Diagnostics.Debug.WriteLine("Value " + myAlarmItem.Value + "\r\n");
}
Take also a look here how to get the DynProperties:
http://www.copadata.com/forums/showthread.php?t=1004
Regards,
Bernhard