Select to view content in your preferred language

Find Model Source Location

1848
8
01-06-2021 08:23 AM
NickWeil
Regular Contributor

I have an ArcGIS Pro project that I haven't touched in quite awhile. I opened it the other day and had a model open, but could not remember where I had it saved. It was not in the toolbox tab in the catalog view. I clicked around in the ModelBuilder ribbon and while I could save and export the model, as well as see where all the inputs are coming from, I cannot find where the actual model is.

This seems like a straightforward thing, but I cannot figure it out. Any help would be appreciated!

8 Replies
DanPatterson
MVP Esteemed Contributor

Do you create a default toolbox when you start a project?

If so, was it not in there?

Create a model tool—ArcGIS Pro | Documentation


... sort of retired...
Robert_LeClair
Esri Notable Contributor

Sometimes things get lost in a Default.gdb that's created with the initial project.  If you don't change the path WHERE the *.aprx is initially created, it gets created in the C:\Users\<user profile>\Documents\ArcGIS\Projects folder by default.  Check and see if you have any projects there and the accompanying *.tbx. Maybe it's there?

NickWeil
Regular Contributor

Yes, I do create a default toolbox when starting a project.  I had also registered another toolbox with the project. This particular model was not in either of those toolboxes.

I had navigated to another toolbox through catalog and opened it that way.

NickWeil
Regular Contributor

@Robert_LeClairI checked this location and the missing .tbx was not to be found. I checked some other locations I had been using and found the missing toolbox and associated model on another server.

The immediate issue is fixed, but the larger question remains - is there an easy way to find the source of a model?

0 Kudos
DanPatterson
MVP Esteemed Contributor

Not unless you examine the toolboxes, perhaps using python ... arcpy.AddToolbox

model_save.png

tbx = arcpy.AddToolbox(pth)
tbx = arcpy.AddToolbox(pth)

dir(tbx)
Out[12]: ['AttributeSort', ... snip ..., 'Model', ... snip ..., 'Triangulate', '__alias__', '__all__', '__builtins__', '__doc__', '__loader__', '__name__', '__package__', '__pathname__', '__spec__', 'test']

... sort of retired...
0 Kudos
Robert_LeClair
Esri Notable Contributor

Nick - I'll preface this reply by saying I am not a Python person in the slightest but I found some Python snippets from a Blog that may help.  You can find it referenced here.

0 Kudos
DanPatterson
MVP Esteemed Contributor

You can always look for projects using os.walk or arcpy's equivalent to find projects

ArcGISProject—ArcGIS Pro | Documentation

then look for the default toolboxes

ArcGISProject Class

The project's default toolbox location. The string must include the toolbox's full path and file name.

But... just saving it to a new toolbox and remembering next time to overtly specify a saving location would be easiest, like you can with regular *.tbx files


... sort of retired...
0 Kudos
NickWeil
Regular Contributor

Thank you @DanPatterson and @Robert_LeClair for your suggestions on this topic. Unfortunately, it appears that there is no way to find the source location of a model that is open.

I created an ArcGIS Ideas post about this issue. If you encounter this problem as well, please give the idea some support.