COM object EvRegionsCollection

EvApplication > EvFileCollection > EvFile > EvRegionsCollection

 

View the COM map and the COM summary.

The EvRegionsCollection object gives you access to information about the set of regions defined, and the ability to import region definitions into an EV file. A region is an item in the EvRegionsCollection, which is accessed via the EvFile.Regions[] property.

The EvRegion object allows you to find specific information or modify specific information about a region in the EvRegionsCollection.

EvRegionsCollection methods and properties:

Count
Delete
DeleteByClass
ExportDefinitions
ExportDefinitionsAll
FindByName
Import
Item

 

Description

Count

(read-only) integer Count

Summary

Get the number of regions in the collection.

Delete

boolean Delete(EvRegion RegionToDelete)

Summary

Delete the Region object specified by the parameter RegionToDelete. The Region object is accessed through EvFile.Regions.

Return

True, if successful.

Example
Dim EvApp: Set EvApp = CreateObject("EchoviewCom.EvApplication")
Dim EvFile: Set EvFile = EvApp.OpenFile("c:\Test files\regiondelete.EV")
If EvFile Is Nothing Then
        MsgBox "Failed to open EV file"
Else
        Dim R: Set R = EvFile.Regions.FindByName("Region1")
        If R Is Nothing Then
                 MsgBox "Failed to find region"
        Else
        
                If Not EvFile.Regions.Delete(R) Then
                        MsgBox "Failed to delete regions"
                End If 
        End If
End If

DeleteByClass

boolean DeleteByClass(EvRegionClass Class)

Summary

Delete the regions in a Region class specified by Class. The Class parameter is a EvRegionClass object accessed through EvFile.RegionClasses.

Return

True, if successful.

Example
      Option Explicit
        Dim EvApp: Set EvApp = CreateObject("EchoviewCom.EvApplication")
        
        Dim EvFile
        Set EvFile = EvApp.EvFiles.Item(0)
        Dim RC
        Set RC = EvFile.RegionClasses.FindByName("Class1")
        
        EvFile.Regions.DeleteByClass(RC)

ExportDefinitions

boolean ExportDefinitions(string FileName, EvRegionClass)

Summary

Export the region definition of all regions (in the EV file) to the specified filename.

Notes:

Parameters
  • FileName
  • The path and name of the file to save the exported region definitions to.
  • EvRegionclass
  • Specifies the region class or region classes as an EvRegionClass object.
  • If using VBScript, specify 'Nothing' for EvRegionClass to export all region classes.
  • Note: If a region class is specified only that region class will be exported. When not specified, all region classes are exported.
Return

True if successful.

ExportDefinitionsAll

boolean ExportDefinitionsAll(string FileName)

Summary

Export the region definition of all regions (in the EV file) to the specified filename. This method is suited to MATLAB scripts (that do not accept an empty parameter that may occur with the method ExportDefinitions).

Notes:

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

True if successful.

FindByName

FindByName(string RegionName)

Summary

Find the Region object specified by RegionName in the RegionsCollection.

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

Return

Null if RegionName can not be found.

Import

boolean Import(string FileName)

Summary

Import the 2D regions from the specified 2D region definition .evr file.

Return

True, if successful.

Item

(read-only) Item[]

Summary

Gives access to a specific region in the EvRegionsCollection by index. Indexes are zero-based, so valid indexes are from 0 to Count-1. The result is an EvRegion object.

Item is the default property for this interface. The examples on the EvFileCollection page show several ways to use the Item property.

See also

Scripting with COM objects
COM object hierarchy
EvRegion object
EvRegionClass object
EvRegionClassesCollection