Select to view content in your preferred language

How do you access the output of iGpDispatch.ListIndexes method in VB.net?

596
1
06-26-2011 10:47 AM
NicholasReseburg1
Occasional Contributor
Hello.  I am working on a program that will list the indexes in a featureclass.  I am trying to use the iGpDispatch method of the geoprocessing object.  I think I am doing good up to the point where I run the actual ???listindexes??? method.  I am not how to handle the results of this method. 
Do I dim an object and set it to the value of pGpDispatch?  Like

dim objObject as pGpDispatch.listindexes(pGxObject)???
and then just type for each index in objObject.index
strIndex = objObject.Nameetc.

or do I need to do a
With  pGpDispatch.listindexes(pGxObject)

and then get the properties I want?  I played around with several ways, but the lack of IntelliSense suggestions leads me to believe I am wrong.

Here is the code I have so far.  Currently it is a standalone windows form executable so I am getting the feature class from a GxDialog and making it into a GxOBject.

Any suggestions on ways to go would be most appreciated!


Code:
Imports ESRI.ArcGIS.Catalog
Imports ESRI.ArcGIS.CatalogUI
Imports ESRI.ArcGIS.Geoprocessing

Public Class IndexBuilder_Startup

    Private Sub cmdGetFC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdGetFC.Click
        Dim pEnumGX As IEnumGxObject
        Dim pGxDialog As IGxDialog = New GxDialogClass
        With pGxDialog
            .Title = "Choose File To Search For Indexes On"
            .StartingLocation = ???\\DataDrive\???
            .ObjectFilter = GetFilter()
        End With

        If Not pGxDialog.DoModalOpen(0, pEnumGX) Then
            Exit Sub
        End If

        Dim objGxObject As IGxObject = pEnumGX.Next
        TextBox1.Text = objGxObject.Name

        Dim gp As IGeoProcessor
        gp = New GeoProcessor

        Dim pDispatch As IGpDispatch
        pDispatch = gp

        '' This is where i am stuck.  

        objGxObject = pDispatch.ListIndexes(objGxObject)
        For Each index In objGxObject.index
        ' ???????
        Next
    End Sub

    Private Function GetFilter() As Object
       Dim objFilter As IGxObjectFilter = New GxFilterPGDBFeatureClasses
        Return objFilter
    End Function
0 Kudos
1 Reply
YaminiManickam
Occasional Contributor
Here is a VBA sample that demonstrates the use of ListIndexes function:

How to list indexes - http://help.arcgis.com/en/sdk/10.0/vba_desktop/conceptualhelp/index.html#//00010000012v000000

For more information on the function, please see:

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000001r000000.htm

I hope this helps.
0 Kudos