I have made a ArcGIS Pro add-in to run a series of geoprocessing tools and some data massaging by ArcGIS Pro SDK. Now I wants to show the progress message to a dialog similar to the one below, I have tried Geoprocessing.ShowMessageBox() but it can only show the messages after the geoprocessing tool is completed. Are there any ways to do so?
Solved! Go to Solution.
Hi @MatsHardy ,
you can do something like below to show progressor in ArcGIS pro SDK .NET for GP tool,
var mergeDlg = new ProgressDialog($"GP tool message dialog", "Cancel", 100, false);
var progsrc=new CancelableProgressorSource(mergeDlg);
progsrc.Value = 0;
progsrc.Message = $"GP tool message";
var gpResult = await Geoprocessing.ExecuteToolAsync(tool_path, parameters, environments, progsrc.Progressor, GPExecuteToolFlags.AddToHistory);
progsrc.Value = 0;
progsrc.Message = $"GP tool1 message";
var gpResult1 = await Geoprocessing.ExecuteToolAsync(tool_path, parameters, environments, progsrc.Progressor, GPExecuteToolFlags.AddToHistory);
You should implement the ProgressDialog as described in the thread.
Also, you can check the community sample https://github.com/Esri/arcgis-pro-sdk-community-samples/tree/master/Framework/ProgressDialog
Thanks for your help. But the progress dialog can only the progress of one geooprocessing tool. Now I have to run many geoprocessing tools in the add-in. How the show the progress of the tools in one dialog?
Hi @MatsHardy ,
you can do something like below to show progressor in ArcGIS pro SDK .NET for GP tool,
var mergeDlg = new ProgressDialog($"GP tool message dialog", "Cancel", 100, false);
var progsrc=new CancelableProgressorSource(mergeDlg);
progsrc.Value = 0;
progsrc.Message = $"GP tool message";
var gpResult = await Geoprocessing.ExecuteToolAsync(tool_path, parameters, environments, progsrc.Progressor, GPExecuteToolFlags.AddToHistory);
progsrc.Value = 0;
progsrc.Message = $"GP tool1 message";
var gpResult1 = await Geoprocessing.ExecuteToolAsync(tool_path, parameters, environments, progsrc.Progressor, GPExecuteToolFlags.AddToHistory);
Thanks for your help. I have resolved the problem.