COM object EvFile

EvApplication > EvFilesCollection > EvFile

View the Echoview COM object hierarchy and the Echoview summary of COM objects.

The EvFile object accesses information about and performs actions on an EV file.

The EvApplication.EvFiles[] property lists all the EV files that are open in Echoview and is an EvFilesCollection.

The following EvFile methods and properties are detailed below:

Methods

Properties: Collections, Classes and Members

Close
Save
SaveAs
PreReadDataFiles
Import
IsLiveViewing

FileName
FileSets
Variables
Regions
RegionClasses
Lines
Scenes
Objects3D
Properties

EvFile offers the following methods and properties:

EvFile methods

Description

Close

boolean Close()

Summary

Close the EvFile.

Parameters

None.

Return

The status of the operation; true for success, false for failure.

 

See also: EvApp.CloseFile.

Save

boolean Save()

Summary

Save any changes made to the EvFile.

Parameters

None.

Return

The status of the operation; true for success, false for failure. The save is attempted regardless of whether or not the EV file is changed. This will always fail if the EV file has just been created.

SaveAs

boolean SaveAs(string FileName)

Summary

Save the EvFile to a new location.

Parameters
  • FileName
  • The path and name of the file to save to.
Return

The status of the operation; true for success, false for failure.

PreReadDataFiles

PreReadDataFiles

Summary

Pre-reads an EV file. This is equivalent to using the Echogram keyboard shortcut P.

Parameters

The EV file can be specified by an EvApplication method or similar.

Example
Dim EvApp: Set EvApp = CreateObject("EchoviewCom.EvApplication")
Dim EvFile: Set EvFile = EvApp.OpenFile("C:\Myriax\Echoview4\prereadtest.ev")
If EvFile Is Nothing Then
        MsgBox "Failed to open EV file"
Else
EvFile.PreReadDataFiles
End if

Import

boolean Import(string FileName)

Summary

Import the specified file as though using the Import item in the File menu. If the file cannot be imported, a message is sent to the scripting log file. See Importing in Echoview for information on the supported file formats for lines, regions, 3D objects etc.

Parameters
  • FileName
  • The path and name of the file to attempt to load.
Return

True when the import is successful. False when the import fails.

Example
    Dim EvApp: Set EvApp = CreateObject("EchoviewCom.EvApplication")
    Dim EvFile: Set EvFile = EvApp.OpenFile("c:\Test files\svgain.EV")
    If EvFile Is Nothing Then
           MsgBox "Failed to open EV file"
       Else
              EvFile.Import("c:\Test files\Copy of Line1.evl")
    End If

IsLiveViewing

boolean IsLiveViewing(string EVFileName)

Summary

Checks whether the specified EV file is being used for live viewing.

Parameters
  • EVFileName
  • The name of the EV file being used for live viewing.
Return

True if the EV file is being used for live viewing, false otherwise.

Example
Dim EvApp: Set EvApp = CreateObject("EchoviewCom.EvApplication")
For FileIndex = 0 To EvApp.EvFiles.Count-1
    Dim EvFile: Set EvFile = EvApp.EvFiles(FileIndex)
    If EvFile.IsLiveViewing Then
        MsgBox "File " + EvFile.FileName + " is live viewing."
    Else
        MsgBox "File " + EvFile.FileName + " is not live viewing."
    End If
Next

 

EvFile properties

Description

FileName

(read-only) string FileName

Summary

Name of the file.

Filesets

(read-only) Filesets[]

Summary

Collection of filesets in the file.

Variables

(read-only) Variables[]

Summary

Collection of variables in the file.

Regions

(read-only) Regions[]

Summary

Collection of regions in the file.

Note: When two regions have the same name, the first one found is used.

RegionClasses

(read-only) RegionClasses[]

Summary

Collection of regions classes in the file.

Lines

(read-only) Lines[]

Summary

Collection of lines in the file.

Scenes

(read-only) Scenes[]

Summary

Collection of scenes in the file.

Objects3D

(read-only) Objects3D[]

Summary

Collection of 3D objects in the file.

Properties

(read-only) Properties

Summary

The EV file properties in the file, accessed through the EvFileProperties object.

Supported EV file properties include selected settings on the:

  • Schools page
  • Export page
  • EV file page (Data file locations)
  • Line pick page
  • Fish tracks page (Fish track properties)
  • Classes page (Species properties)

See also

Scripting with COM objects
EvFilesCollection