How do I know when a tool has been executed?

428
1
01-08-2019 09:46 AM
MaximilianGlas
Esri Contributor

Hi,

I use a tool from ArcGIS Pro to convert data from Excel by drag and drop on the map pane.

I used this example as template, but instead of executing this part automatically ...

            var result = await Geoprocessing.ExecuteToolAsync("MakeXYEventLayer_management", new string[] {
                xlsTableName,
                "POINT_X",
                "POINT_Y",
                xlsLayerName,
                "WGS_1984"
}, environments);‍‍‍‍‍‍‍

I want to call the tool in the GP pane, which lets the user the possibility to change settings:

           var paramValues = Geoprocessing.MakeValueArray(xlsTableName, string.Empty, string.Empty, layerName);
           var path = Path.Combine(@"C:\Program Files\ArcGIS\Pro\Resources\ArcToolBox\Toolboxes\Data Management Tools.tbx", "MakeXYEventLayer");
           Geoprocessing.OpenToolDialog(path, paramValues);‍‍‍‍‍‍‍‍‍‍‍‍

This works fine, but of course the user has now to execute the tool manually and after that, I want to call the ApplySymbology Tool (as in the sample code shown):

            await Geoprocessing.ExecuteToolAsync("ApplySymbologyFromLayer_management", new string[] {
              xlsLayerName, 
              @"C:\Data\SDK\Default2DPointSymbols.lyrx"
});‍‍‍‍

But how do I get the event when the user has executed the MakeXYEventLayer Tool?

Kind regards,

Max

0 Kudos
1 Reply
Robert_LeClair
Esri Notable Contributor

I wonder if creating a Script tool for ArcGIS Pro would be a possible avenue to explore?

0 Kudos