COM object EvApplication

The EvApplication object represents the Echoview program. It contains methods and properties to access information about the running instance of Echoview and the EV files that are open.

View the COM map and the COM summary.

Use EvApplication to access Echoview via COM. All Echoview’s COM automation functionality is begun through this object. Refer to Scripting with COM objects - Creating a script.

EvApplication collections:

DataLoggers
EvFiles

EvApplication methods and properties:

BringToFront
CloseFile
Exec
ExportOperatorDataTypeList
ExportPropertyInformation
GetLastLogMessage
IsLicensed
LiveViewingDataLogger
Log
LogFileName
Minimize

NewFile
OpenFile
Quit
Restore
StartLiveViewing
StopLiveViewing
Version

Collections

Description

DataLoggers

(read-only) DataLoggers[]

Summary

View the data loggers available for live viewing. DataLoggers refers to EvDataLoggersCollection.

Example

Refer to Data logger snippet.

EvFiles

(read-only) EvFiles[]

Summary

Read-only EvFileCollection object containing a reference to an EV file for each open document.

This is used for iterating through all open EV files or for searching for an open EV file by file name.

 

Methods and Properties

Description

BringToFront

BringToFront()

Summary

Attempts to bring the Echoview window to the front of the user's workspace; this will restore the window if it has been minimized.

However it may not actually bring the window to the front, and just flash the Echoview Taskbar button (this is a feature of Windows, to prevent an active application from changing without user intervention).

CloseFile

CloseFile(EvFile oFileName)

Summary

Closes an open EV file. Closes the file connected to the EvFile object.

Parameters
  • oFilename
  • The EvFile object that refers to the EV file to be closed.
Return

None.

 

See also: EvFile.Close.

Exec

string Exec(string CommandLineText)

Summary

This method accepts, issues and executes your command interface instructions.

Parameters
  • CommandLineText
Example

This snippet displays the distance between grid lines, changes the distance and outputs the new grid distance.

Dim evApp: Set evApp = GetObject(, "EchoviewCom.EvApplication")
evApp.Exec("sv* | GridXAxisSpacingInNauticalMiles") evApp.exec("sv* | GridXAxisSpacingInNauticalMiles =| 22") evApp.Exec("sv* | GridXAxisSpacingInNauticalMiles")
Return

A string. Refer to the console output for some examples.

ExportOperatorDataTypeList

boolean ExportOperatorDataTypeList(string FileNameURL)

Summary

Exports a text file for Echoview operator information output as comma separated variables. The data consists of: OperatorName, OperatorType, OperandNumber, OperandDataType.

Parameters
  • FileNameURL
  • Path and file name for the text file.
Return

True if successful.

Example
Dim vEchoviewCom: Set vEchoviewCom = GetObject(, "EchoviewCom.EvApplication")
                vEchoviewCom.ExportOperatorDataTypeList ("D:\PathTo\YourFileName.txt")

ExportPropertyInformation

boolean ExportPropertyInformation(string FileNameURL)

Summary

Exports a text file for Echoview properties as comma separated variables. The data the same as output under Properties Information window, right-click menu Export.

Parameters
  • FileNameURL
  • Path and file name for the text file.
Return

True if successful.

Example
Dim vEchoviewCom: Set vEchoviewCom = CreateObject("EchoviewCom.EvApplication")
vEchoviewCom.ExportPropertyInformation("YourFileURL")

boolean ExportOperatorDataTypeList(string FileNameURL)

Summary

Exports a text file for Echoview operator information output as comma separated variables. The data consists of: OperatorName, OperatorType, OperandNumber, OperandDataType.

Parameters
  • FileNameURL
  • Path and file name for the text file.
Return

True if successful.

Example
Dim vEchoviewCom: Set vEchoviewCom = GetObject(, "EchoviewCom.EvApplication")
                vEchoviewCom.ExportOperatorDataTypeList ("D:\PathTo\YourFileName.txt")

GetLastLogMessage

string GetLastLogMessage()

Summary

Returns the last message logged by Echoview. Useful after a method fails.

Parameters

None.

Return

The last message.

Note: See also Scripting errors.

IsLicensed

boolean IsLicensed()

Summary

Returns a boolean to indicate whether Echoview is licensed for automation.

Parameters

None.

Return

True if Echoview has the required module for COM automation and is licensed, false if not.

LiveViewingDataLogger

(read-only) LiveViewingDataLogger

Summary

View the data logger used for live viewing. LiveViewingDataLogger refers to EvDataLogger.

Example

Refer to Data logger snippet.

Log

boolean Log(string Message)

Summary

Adds a message to the Echoview log.

Parameters

The message to log and the Echoview message bar.

Return

Whether successful.

Note: See also Scripting errors.

LogFileName

(read-write) String LogFileName

Summary

The name of the file that the Echoview log is written to.

The behavior of the property includes:

  • When an empty file name string is used, Echoview saves the log file to the original log file path (by default C:\Users\Public\Documents\Echoview Software\Echoview M.m\).
  • When a file name is used, the log file is changed to the specified file name with the file located in the original file path.
  • When a file name includes an absolute path, the log file is saved to the absolute path.
Example
Dim EvApp: Set EvApp = CreateObject("EchoviewCom.EvApplication")
              EvApp.Log(EvApp.LogFileName)
              MsgBox(EvApp.LogFileName)

              ' Test change path (absolute)
              EvApp.LogFileName="C:\temp\evtest.log"
              MsgBox("Change (absolute): " & EvApp.LogFileName)
              EvApp.Log("Change (relative): " & EvApp.LogFileName)


              ' Test change filename
              EvApp.LogFileName="evtest_001.log"
              MsgBox("Change (filename): " & EvApp.LogFileName)
              EvApp.Log("Change (filename): " & EvApp.LogFileName)

              ' Test reset
              EvApp.LogFileName=""
              MsgBox("Reset: " & EvApp.LogFileName)
              EvApp.Log("Reset: " & EvApp.LogFileName)

Refer to Creating a script for another example of this property's usage.

 

Note: See also Scripting errors.

Minimize

Minimize()

Summary

Minimizes the Echoview window.

NewFile

EvFile NewFile(String Filename)

Summary

Creates a new EV file and returns the EvFile object for it.

Parameters

Filename (optional)

The full path to a template.

Return

An EvFile object for the newly created document.

OpenFile

EvFile OpenFile(String FileName)

Summary

Opens an EV file.

Parameters
  • FileName
  • The path to an existing EVfile.
Return

An EvFile object for the newly opened document.

Quit

Quit()

Summary

Closes the connected instance of Echoview.

Note: Quit closes Echoview whether the instance was opened manually or opened using the COM interface.

Parameters

None.

Return

None.

Restore

Restore()

Summary

Restores the Echoview window to the state it was in prior to Minimize().

Parameters

None.

Return

None.

StartLiveViewing

boolean StartLiveViewing(EvDataLogger oDataLogger)

Summary

Start live viewing with the specified data logger.

Parameters
Return

True, if successful.

Example
Dim oEvApp: Set oEvApp = CreateObject("EchoviewCom.EvApplication")
              If oEvApp.DataLoggers.Count = 0 Then
              MsgBox "No data loggers yet. Retry?"
              If oEvApp.DataLoggers.Count = 0 Then
              MsgBox "Still no data loggers. Quitting."
              WScript.Quit
              End If
              End If
              If oEvApp.DataLoggers.Count > 1 Then
              Dim iLogger
              For iLogger = 0 To oEvApp.DataLoggers.Count - 1
              MsgBox oEvApp.DataLoggers(iLogger).Description
              Next
              End If
              Dim oLogger: Set oLogger = oEvApp.DataLoggers(oEvApp.DataLoggers.Count - 1)
              MsgBox "Start live viewing on " & oLogger.Description & "?"
              If oEvApp.LiveViewingDataLogger Is Nothing Then
              If Not oEvApp.StartLiveViewing(oLogger) Then
              MsgBox "Failed to start live viewing with " & oLogger.Description
              WScript.Quit
              End If
              End If
              MsgBox oEvApp.LiveViewingDataLogger.Description & " is live viewing. Stop?"
              oEvApp.StopLiveViewing
              If oEvApp.LiveViewingDataLogger Is Nothing Then
              MsgBox "Stopped live viewing"
              Else
              MsgBox "Failed to stop live viewing"
              End If
          

StopLiveViewing

StopLiveViewing()

Summary

Stop live viewing.

Parameters

None.

Return

None. Live viewing stops.

Example

Refer to Data logger snippet.

Version

(read-only) String Version

Summary

Get a string representation of Echoview’s version number.

Parameters

None.

Return

A string for Echoview’s version number.

Example usage

To connect to Echoview, first create an instance of the EvApplication object:

' Open Echoview (if Echoview is already open, connects to the
        ' open Echoview instance)
        Dim EvApp
        Set EvApp = CreateObject("EchoviewCom.EvApplication")
    

Once done, you can use this object to find information about Echoview or to create, open or access EV files:

' Shows what version of Echoview is running
        MsgBox EvApp.Version
    
' Open an EV file
        Dim MyFile
        Set MyFile = EvApp.OpenFile("c:\Example.EV")
    

See also

Scripting with COM objects
Getting started with scripting
COM object hierarchy