geoprocessor

504
1
10-21-2010 05:54 AM
ludoDupuis
New Contributor
Hi folks,
How can I call a geoprocessor (for instance polygontoline from data management) in a visual basic 6 macro ?

I would like to do somethink similar to this exemple but it is wrtitten in VBnet and I do not find the equivalent for VB6

'Exemple
    'Dim GP As New ESRI.ArcGIS.Geoprocessor.Geoprocessor
    'Dim pUnion As New ESRI.ArcGIS.AnalysisTools.Union

    'pUnion.in_features = "C:\TestData\VP  _Testdata\trails_buf.shp #;C:\TestData\VP  _Testdata\Spawning_area_clp.shp #"
    'pUnion.out_feature_class = C:\temp\Union_Out1.shp"

    'GP.Execute(pUnion, Nothing)

thanks so much in advance
0 Kudos
1 Reply
ludoDupuis
New Contributor
Sorry I found it
it look like that if somebody needs it

    '//Initialize the Geoprocessor
    Dim GP As IGeoProcessor
    Set GP = New Geoprocessor
   
    '//Declare 3 variables for input and output parameters
    Dim in_features As String
    Dim out_features As String
    '//Define the input/output parameter variables
    in_features = "D:\temp\input.shp"
    out_features = "D:\temp\output.shp"
    '//Declare and set a variant array to hold the parameters
    Dim parameters As IVariantArray
    Set parameters = New VarArray
    '//Populate the variant array with the parameters
    parameters.Add (in_features)
    parameters.Add (out_features)
    '//Now execute the tool
    GP.Execute "PolygonToLine_management", parameters, Nothing

it is not so complicated after all !
cheers
0 Kudos