COM object EvTransectGroup
|
EvApplication > EvFileCollection > EvFile > EvTransectGroupCollection > EvTransectGroup
View the COM map and the COM summary. |
The EvTransectGroup object corresponds to a transect group, and gives you access to information about and the ability to modify selected settings on the Transect group properties dialog box.
The EvFile.TransectGroups [] property lists all the transect groups in an EV file and is an EvTransectGroupCollection.
EvTransectGroup methods and properties:
|
|
Description |
|
boolean ExportTransects(string ExportPath) SummaryExports the transects of a transect group. Refer to transect group table for details on each field. Example |
|
|
(read-write) string Name SummaryGet or set the Name of the transect group on the General page of the Transect Group Properties dialog box. ExampleDim vEchoviewCom: Set vEchoviewCom = GetObject(, "EchoviewCom.EvApplication")
main
Sub main
Dim vEvFile: Set vEvFile = vEchoviewCom.OpenFile("YourEVFilePathAndName.EV")
' Export the variables data without transects for reference
' This also conveniently also causes all the data to be cached so we indirectly test invalidation later
Dim sv: Set sv = vEvFile.Variables.FindByName("Fileset 1: Sv raw pings T1")
Dim platform: Set platform = vEvFile.Platforms.Item(0)
sv.ExportIntegrationByCellsAll("YourExportIntegration by cells (initial).csv")
Dim transectGroup
Set transectGroup = vEvFile.TransectGroups.Import("YourTransectGroupToImport.csv")
' Should have 1 transect group equal to the transect group return
If vEvFile.TransectGroups.Count <> 1 OR Not vEvFile.TransectGroups.Item(0) Is transectGroup Then
MsgBox("Expected document to only contain the imported transect group")
Exit Sub
End If
' Try changing name and notes
transectGroup.Name = "Survey 2023-04-03"
transectGroup.Notes = "Survey used for testing purposes"
If transectGroup.Name <> "Survey 2023-04-03" Then
MsgBox("Failed to set transect group name")
Exit Sub
End If
If transectGroup.Notes <> "Survey used for testing purposes" Then
MsgBox("Failed to set transect group notes")
Exit Sub
End If
' Fetch transect group by name
Dim transectGroup2: Set transectGroup2 = vEvFile.TransectGroups.FindByName("Survey 2023-04-03")
If Not transectGroup2 Is transectGroup Then
MsgBox("Failed to find transect group by name")
Exit Sub
End If
' Assign the imported transect group to the platform so it's used by analysis
platform.TransectSource = transectGroup
if Not platform.TransectSource Is transectGroup Then
MsgBox("Failed to assign transect group to platform")
Exit Sub
End If
sv.ExportIntegrationByCellsAll("BaselineExportIntegration by cells with transects.csv")
' Export transects
transectGroup.ExportTransects("YourExportWithTransectGroupSurvey 2023-04-03.transect.csv")
' Delete transect group
vEvFile.TransectGroups.Delete(transectGroup)
If vEvFile.TransectGroups.Count <> 0 Then
MsgBox("Failed to delete transect group")
Exit Sub
End If
sv.ExportIntegrationByCellsAll("ReturnToBaselineExporIintegration by cells without transects.csv")
End Sub
|
|
|
(read-write) string Notes SummaryGet or set the Notes of the transect group on the General page of the Transect Group Properties dialog box. ExampleEvTransectGroup snippet |