All the functions of ET GeoWizards 12 can be used in custom applications developed in .NET. The syntax of each ET GeoWizards function is described in the main topic of the function ==> .NET implementation.
There are two ways to execute the functionality of ET GeoWizards 12 in .NET
Prerequisites
Private Sub Button1_Click(sender As Object, e
As EventArgs) Handles Button1.Click 'Set the path to ETGWRun.exe Dim ETRunPath As String = "C:\Program Files\ETSpatial Techniques\ETGeo Wizards\ETGWRun.exe" 'We are going to use the Explode Multipart Features for thei example Dim sFunction As String = "ExplodeMultipart" '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\aaaa.shp" & Chr(34) 'Set the full name of the output Dim sOutFN As String = Chr(34) & "C:\testData\0000result3.shp" & Chr(34) 'Execute the ExplodeMultipart function Dim sArgumentList As String = sFunction & " " & sInDataset & " " & sOutFN 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 ETGWOutRun Dim ETGWOut As ETGWOutX.ETGWOutRun = New ETGWOutX.ETGWOutRun(True) 'We are going to use the Explode Multipart Features for the example 'Set the input dataset with the full path to the shapefile Dim sInDataset As String = "C:\testData\input.shp" 'Set the full name of the output Dim sOutFN As String = "C:\testData\result.shp" 'Execute the ExplodeMultipart function Dim iResult As Integer = ETGWOut.ExplodeMultipart(sInDataset, sOutFN) '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 |