Select to view content in your preferred language

How to Show Progress Messages in GeoProcessing Dialog?

336
4
Jump to solution
08-12-2024 05:15 AM
MatsHardy
Regular Contributor

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?

MatsHardy_0-1723464875307.png

 

0 Kudos
1 Solution

Accepted Solutions
SumitMishra_016
Regular Contributor

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);

View solution in original post

4 Replies
Aashis
by Esri Contributor
Esri Contributor

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

 

0 Kudos
MatsHardy
Regular Contributor

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?

0 Kudos
SumitMishra_016
Regular Contributor

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);

MatsHardy
Regular Contributor

Thanks for your help. I have resolved the problem.

0 Kudos