''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' EV script 002 - Changing variable properties in multiple variables in multiple EV files ' Example Echoview COM script downloaded from www.echoview.com ' For support, contact the Echoview support team ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' option explicit Dim EvApp: Set EvApp = CreateObject("EchoviewCom.EvApplication") 'Add the location of your EV files here. You can have as many or as few EV files as you like ChangeProperties "C:\Folder\EvFile1.ev" ChangeProperties "C:\Folder\EvFile2.ev" ChangeProperties "C:\Folder\EvFile3.ev" ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' A subroutine to run the changes on the selected variables Sub ChangeProperties(FileName) Dim EvFile: Set EvFile = EvApp.OpenFile(FileName) If EvFile Is Nothing Then MsgBox "Failed to open EV file '" & FileName & "'" Exit Sub End If 'Add the names of your variables here. You can have as many or as few variables as you like ChangeVariableSettings EvFile, "Sv Q1 telegrams T1" ChangeVariableSettings EvFile, "Resample variable 1" ChangeVariableSettings EvFile, "Resample variable 2" ChangeVariableSettings EvFile, "Single target variable" EvApp.CloseFile(EvFile) End Sub ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' A subroutine to change specific properties in the selected variables Sub ChangeVariableSettings(EvFile, VarName) Dim Var: Set Var = EvFile.Variables.FindByName(VarName) If Var Is Nothing Then MsgBox "Failed to find variable '" & VarName & "' in EV file '" & EvFile.FileName & "'" Exit Sub Else Dim VarAc: Set VarAc = Var.AsVariableAcoustic If VarAc Is Nothing Then MsgBox "Variable is not acoustic" Else 'Set the variable properties you want to change here. This example changes grid settings VarAc.Properties.Grid.SetDepthRangeGrid 1, 5 VarAc.Properties.Grid.SetTimeDistanceGrid 5, 100 End If EvFile.Save End If End Sub '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''