After reviewing available examples and references (only available in Python), I am unable to pass a successful Geoprocessing.MakeValueArray into the ExecuteToolAsync. I am confident it is a C# #syntax issue, and need some help...
Example Code:
main_lyr.Select(qf, SelectionCombinationMethod.New);
var in_table = main_lyr;
var out_table = Path.Combine(Project.Current.DefaultGeodatabasePath, GVar.FtrLyr + " Results");
var statistics_fields = "FEET, Sum"; //[['FEET', 'SUM']]";
var case_field = "Diameter"; // "['Diameter']";
var args = Geoprocessing.MakeValueArray(in_table, out_table, statistics_fields, case_field);
var sp_ref = SpatialReferenceBuilder.CreateSpatialReference(102629); // NAD83 SP AL E FIPS 0101 Feet
var envi = Geoprocessing.MakeEnvironmentArray(outputCoordinateSystem: sp_ref);
Geoprocessing.ExecuteToolAsync("Statistics_analysis", args, envi, null, null, GPExecuteToolFlags.Default);
Solved! Go to Solution.
Firstly, THAT worked! "FEET Sum"
Just to clarify, the syntax documented here in the arcpy environment:
Summary Statistics—Help | ArcGIS Desktop
is
[["Shape_Area", "SUM"]]
Thank you.
Let’s communicate via email until we find a solution – if it is okay with you. Thanks.
Ok, Nobbir. I'm satisfied with the solution syntax you provided in the previous post. I can move forward with my Add-in code now. Thanks.
Most probably you are right about: *****syntax of these variables is assumed to be the failure*****
I'll forward this to appropriate team. Meanwhile, I'll try to find a workaround. Thanks for your patience.