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?

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.