Hi - I'm not having success running the Summarize Attributes tool in the GeoAnalytics Desktop Tools using ExecuteToolAsync in ArcPro sdk 3.0. Below is my code. Am I approaching this the correct way? I'm not sure if the tool name is correct, and I don't think the parameters I'm passing are correct either
//summarize landscape classifications
var progSumDlg = new ProgressDialog("Running Geoprocessing Tool", "Cancel", 100, true);
progSumDlg.Show();
var sum_tool_name = "geoanalytics.Summarize";
//layer to summarize
var summarizeLayer = MapView.Active.Map.GetLayersAsFlattenedList().OfType<FeatureLayer>().First(l => l.Name.Equals("test_clip"));
//field to classifiy and field to get stats for
Table table = summarizeLayer.GetTable();
TableDefinition tableDefinition = table.GetDefinition();
Field classField = tableDefinition.GetFields().FirstOrDefault(x => x.Name.Contains("Class_name"));
Field statField = tableDefinition.GetFields().FirstOrDefault(x => x.Name.Contains("Ft2"));
//output table
var out_table = System.IO.Path.Combine(gdb, "test_clip_summary");
var sum_params = await QueuedTask.Run(() =>
{
return Geoprocessing.MakeValueArray(new object[] { summarizeLayer, out_table, classField, statField});
});
await Geoprocessing.ExecuteToolAsync(sum_tool_name, sum_params,
null, new CancelableProgressorSource(progSumDlg).Progressor, GPExecuteToolFlags.Default);
thanks
Pete