All the functions of ET Surface 7 can be used in custom applications developed in .NET. The syntax of each ET Surface function is described in the main topic of the function ==> .NET implementation.
There are two ways to execute the functionality of ET Surface in .NET
Prerequisites
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click 'Set the path to ETSRun.exe Dim ETRunPath As String = "C:\Program Files\ETSpatialTechniques\ETSurface\ETSRun.exe" 'We are going to use the Create TIN function for the example Dim sFunction As String = "CreateTin" 'Set the input dataset with the full path to the shapefile. Note that the Argument separator is space. If a string might contain a space, you need to double quote it. Dim sInDataset As String = Chr(34) & "C:\testData\points.shp" & Chr(34) 'Set the full name of the output Dim sOutTin As String = Chr(34) & "C:\testData\PointTin" & Chr(34) 'Set the name of the field to be used for elevation values. Dim sFieldName As String = Chr(34) & "Elevation" & Chr(34) 'Set the triangulation type. Dim sTriangulation As String = Chr(34) & "Point" & Chr(34) 'Execute the CreateTin function Dim sArgumentList As String = sFunction & " " & sInDataset & " " & sOutTin & " " & sFieldName & " " & sTriangulation Dim wProc As Diagnostics.Process = New Diagnostics.Process Dim procParam As String = sArgumentList wProc.StartInfo.FileName = ETRunPath wProc.StartInfo.Arguments = procParam wProc.Start() Dim wProcID As Integer = wProc.Id wProc.WaitForExit() Dim iResult As Integer If wProc.HasExited Then 'Check the result - iResult = 0 - Success, any other returned value indicate that the function failed. iResult = wProc.ExitCode If iResult = 0 Then MsgBox("Function completed successfully!!!") Else MsgBox("Problems encountered during the execution!!! See the log file for details.") End If End If End Sub |
Prerequisites
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click 'Get reference to ETSOutRun Dim ETSOut As ETSOutX.ETSOutRun = New ETSOutX.ETSOutRun(True) 'We are going to use the Create TIN function for the example 'Set the input dataset with the full path to the shapefile Dim sInDataset As String = "C:\testData\Points.shp" 'Set the full name of the output Dim sOutTin As String = "C:\testData\PointTin" 'Set the name of the field to be used for elevation values. Dim sFieldName As String = "Elevation" 'Set the triangulation type. Dim sTriangulation As String = "Point" 'Execute the CreateTIN function Dim iResult As Integer = ETSOut.CreateTin(sInDataset, sOutTin, sFieldName, sTriangulation) 'Check the result - iResult = 0 - Success, any other returned value indicate that the function failed. If iResult = 0 Then MsgBox("Function completed successfully!!!") Else MsgBox("Problems encountered during the execution!!! See the log file for details.") End If End Sub |