1

In ArcGIS Pro version 2.0.0 I use this code to execute merge tool

    public async Task<bool> ExecuteToolAsync()
    {
    var valueArray = await QueuedTask.Run(() =>
    {
    // Creates a 8000-meter buffer around the geometry object
    // null indicates a default output name is used
    return Geoprocessing.MakeValueArray(_inputs, _output);
    });
    var result = await Geoprocessing.ExecuteToolAsync("Merge_management",
    valueArray);
    return !result.IsFailed;
    }

where _inputs is list of fullpath of layers. it works well.

To execute intersect tool I use this:

    public async Task<bool> ExecuteToolAsync()
    {
    var _inpputs= new List<string>() { _featureLayer1, _featureLayer2 };
    var valueArray = await QueuedTask.Run(() => 
    Geoprocessing.MakeValueArray(_inpputs, _outputFeatureClass, "ALL, "0", 
    "POINT"));
    var result = await Geoprocessing.ExecuteToolAsync("Intersect_analysis", 
    valueArray);
    return !result.IsFailed;
    }

It doesn't work. How can I solve this?

Hornbydd
  • 43,380
  • 5
  • 41
  • 81
osman
  • 193
  • 15

1 Answers1

3

Check out the help page for Intersect http://pro.arcgis.com/en/pro-app/tool-reference/analysis/intersect.htm

For the first parameter you are using a C# string list, but it requires only a single string or a value table.

Rob Burke
  • 46
  • 2