COM object EvRegion

EvApplication>EvFileCollection > EvFile > EvRegionsCollection > EvRegion

 

View the COM map and the COM summary.

The EvRegion object gives you access to information about and the ability to modify an Echoview 2D region or 3D region.

The EvFile.Regions[] property lists all the regions in an EV file and is an EvRegionsCollection.

EvRegion classes:

RegionClass

EvRegion methods and properties:

Classify
EndTime
ExportDefinition
Id
Kind
Name
Notes
RegionType
ShiftDepth
ShiftTime
StartTime

 

Description

Classify

boolean Classify(EvVariableAcoustic Variable)

Summary

Apply a classification-by-rule to a specified region in an acoustic variable.

Notes:

Parameters
  • Variable
  • The name of the acoustic variable that contains the region to classify.
Return

True when a region class has been changed.

Example
option explicit
MsgBox "Echoview COM Classify a Region"
Dim EvApp
Set EvApp = CreateObject("EchoviewCom.EvApplication")
Dim EvFile
Set EvFile = EvApp.EvFiles.Item(0)
Dim Var: Set Var = EvFile.Variables.FindByName("Sv pings").AsVariableAcoustic()
If Var Is Nothing Then
     MsgBox "Failed to find variable"
Else
    'Classify Region10
    If Not EvFile.Regions.FindByName("Region10").Classify(Var) Then
       MsgBox "Failed to Classify Region10"
    End If 

EndTime

(read-only) DATE1 EndTime

Summary

Get the end time of the region.

ExportDefinition

boolean ExportDefinition(string FileName)

Summary

Export the definition of this region to the given filename.

Note: See also EvFile.Regions.ExportDefinitions.

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

True if successful.

Id

(read-only) Id

Summary

Get a region's unique ID number. The region ID number is visible on the Regions window and may be specified with region exports. An EvRegion.Name or region from EvRegionsCollection is required to access the region ID.

EvRegion.Id has advantages over EvRegion.Name (regions can have the same name) or an index in EvRegionCollections (regions can be deleted and the index may change).

Example
Dim vEchoviewCom: Set vEchoviewCom = GetObject(, "EchoviewCom.EvApplication")
Dim vEvFile: Set vEvFile = vEchoviewCom.EvFiles.Item(0)
Dim vEvRegionsCollection: Set vEvRegionsCollection = vEvFile.Regions
Dim iRegion
For iRegion = 0 To vEvRegionsCollection.Count - 1
MsgBox "Region ID: " + CStr(vEvRegionsCollection(iRegion).Id)
Next
Dim vEvRegion: Set vEvRegion = vEvRegionsCollection.FindByName("Region2")
MsgBox "Region ID from name: " + CStr(vEvRegion.Id)

Kind

(read-only) ERegionKind Kind

Summary

Find out which kind of region this is (a 2D region or 3D region). The output is an enum for ERegionKind.

See also: Enum issue under VBS.

Name

(read-write) string Name

Summary

Get or set the name of the region.

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

Notes

(read-write) string Notes

Summary

Get or set the region notes.

RegionClass

(read-write) EvRegionClass RegionClass

Summary

Get the EvRegionClass object associated with the region.

RegionType

(read-write) ERegionType RegionType

Summary

Get or set the type of the region by using an enum for ERegionType.

Note: eFishTrack = 3 is available as read-only.

See also: Enum issue under VBS.

ShiftDepth

boolean ShiftDepth(double Factor, double Offset)

Summary

Shift the depth of the region using the settings in the Region Editor.

Parameters
  • Factor
  • The value for setting Multiply depths by.
  • Offset
  • The value for the setting then add (m).
Return

True when region depth is shifted.

Example
Dim EvApp: Set EvApp = CreateObject("EchoviewCom.EvApplication")
For FileIndex = 0 To EvApp.EvFiles.Count-1
        Dim EvFile: Set EvFile = EvApp.EvFiles(FileIndex)
        For RegionIndex = 0 To EvFile.Regions.Count-1
                Dim Region: Set Region = EvFile.Regions(RegionIndex)
                If Not Region.ShiftDepth(1.1, 10) Then
                    MsgBox "Failed to ShiftDepth"
                End If
                If Not Region.ShiftTime(0, 0, 1, 0, 0) Then
                    MsgBox "Failed to ShiftTime"
                End If
        Next
Next

ShiftTime

boolean ShiftTime(integer Days, integer Hours, integer Minutes, integer Seconds, integer MilliSeconds)

Summary

Shift the time of the region using the settings in the Region Editor.

Parameters
  • Days
  • The (Add or Subtract) value for the setting days.
  • Hours
  • The (Add or Subtract) value for the setting hours.
  • Minutes
  • The (Add or Subtract) value for the setting minutes.
  • Seconds
  • The (Add or Subtract) value for the setting seconds.
Return

True when region time is shifted.

Example

Refer to ShiftDepth (above).

StartTime

(read-only) DATE1 StartTime

Summary

Get the start time of the region.

1Microsoft Office DATE

See also

Scripting with COM objects
COM object hierarchy
EvRegionsCollection
EvRegionClass object
EvRegionClassesCollection