''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' EV script 008 - Add additional virtual variables to existing EV files ' Example Echoview COM script downloaded from www.echoview.com ' For support, contact the Echoview support team ' In this example the existing EV file has a dataflow chain of a raw Sv variable ' followed by a Resample variable, and we want to include a Ping Subset variable ' in between the two. ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Strict syntax checking Option Explicit 'Set up Echoview and an EV file Dim vEvApp: Set vEvApp = CreateObject("EchoviewCom.EvApplication") Dim vEvFile: Set vEvFile = vEvApp.OpenFile("C:\Temp\Processing EV file.ev") 'Identify the parent variable Dim VarParent1: Set VarParent1 = vEvFile.Variables.FindByName("Sv raw pings T1") 'Create the new variable. The enum for the Ping Subset operator is 62 Dim VarNew: Set VarNew = VarParent1.AddVariable(62) If VarNew Is Nothing Then MsgBox "Failed to create variable" End If 'Identify and set the child variable Dim VarChild1: Set VarChild1 = vEvFile.Variables.FindByName("Resample") If VarChild1 is Nothing Then MsgBox "Failed to create variable" ElseIf Not VarChild1.AsVariableVirtual Is Nothing Then If Not VarChild1.SetOperand(1, VarNew) Then MsgBox "Failed to set operand for the new variable" End If End If 'Optional MsgBox "check results" vEvFile.Save vEvFile.Close ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''