Is there a way to refresh the Pro Catalog view after a custom Python Toolbox tool runs?

2520
7
11-12-2020 04:21 PM
Labels (3)
BobBarker
New Contributor III

In ArcGIS Pro we are running python tools from a python toolbox. You click the desired tool and the standard geoprocessing window opens where you set your variables and click run.  Everything works great and we have geoproccessing results when the tool completes. 

However, is there a way to trigger a refresh in the catalog view so that users see results when the python tool completes?

0 Kudos
7 Replies
DanPatterson
MVP Esteemed Contributor

By refresh catalog... do you mean that the results aren't being added to the map?

If so... check your settings in the Project, backstage under Options, Geoprocessing

add_results_to_map1.png


... sort of retired...
0 Kudos
BobBarker
New Contributor III

I'm looking for something (python or c# method) to cause the Catalog View to refresh when a Geoprocessing Tool completes.  For example, after running a simple python tool to perform a synchronize, the Geoprocessing Pane shows success.  However, the Catalog View does not show the updated metadata resulting from the synchronization. The user would have to manually click the refresh button to view updates.

GPResultWoRefreshofCatalogView.png

0 Kudos
DanPatterson
MVP Esteemed Contributor

There is nothing in the arcpy properties or methods and I don't think there is any ArcToolbox tool

arcpy-functions 


... sort of retired...
0 Kudos
BobBarker
New Contributor III

yeah, we looked at arcpy and c# options but didn't see anything obvious.

0 Kudos
LukeRogers
New Contributor III

Here's the VB solution that ESRI helped me come up with. Their internal way of doing this is supposedly "proprietary" according to Support. So dumb. Perhaps you can adapt to C#.

'Store the current item selection, then refresh all items which updates MetadataDetailsView but it is clunky
Dim selection = Project.GetActiveCatalogWindow.SelectedItems.FirstOrDefault
For Each i In Project.Current.Items
Await QueuedTask.Run(Function()
i.Refresh()
Return True
End Function)
Next
'Now restore the pre-refresh selection
Await Project.GetActiveCatalogWindow().SelectItemAsync(selection, True, True, Nothing)

0 Kudos
LukeRogers
New Contributor III

Anybody ever figure this out? Working in .NET. I think we're looking to refresh the "Details Pane" in the "Catalog Pane" but I haven't sorted this out either. 

0 Kudos
KoryKramer
Esri Community Moderator

This idea was just submitted: https://community.esri.com/t5/arcgis-pro-ideas/arcpy-refreshcatalog-function-for-arcgis-pro/idi-p/13... For those following or discovering this thread because this is functionality you're looking for, please add your kudos to that idea.

0 Kudos