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
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

Sends the string for a single command line to the Echoview Command interface. The return for Exec is a string sent from the Command interface. A successful command line may return text output or a unsuccessful command line may return an error message. In either case, to interpret the return string from the Command interface use Exec return handling funtions.

Parameters
  • CommandLineText
  • A text string that is a single command line written in Command interface syntax for the Echoview Command interface.
Example

This snippet is based on a Command interface example to display the distance between grid lines, change the distance and display the changed grid distance. The interface accepts a single command line at a time.

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

A text string returned from the Echoview Command interface.

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 or not 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 log is written to.

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

Note: See also Scripting errors.

Minimize

Minimize()

Summary

Minimizes the Echoview window.

NewFile

EvFile NewFile(String sFilename)

Summary

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

Parameters

Filename.

An optional parameter, used for specifying the path to an existing EV file or EV file used as a template file.

Return

An EvFile object for the newly created document.

Note: If a template file is specified, this method will first check for a user specified Templates folder path. If unsuccessful the method will check the default path for the Templates folder.

OpenFile

EvFile OpenFile(String sFileName)

Summary

Opens an EV file.

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

An EvFile object for the 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