Issues with feature layers in model builder

3382
6
10-12-2016 05:02 AM
NealBanerjee
Occasional Contributor

I have been having increasing issues model builder that utilizes model parameters as inputs and feature layers in an existing ArcMap table of contents.  I models run successfully for a while, but then if I change the underlying input layers at all (even if if has no impact on the model process), it acts flaky.  For example, I have a simple model that simply calculates three fields in an existing feature class that I have loaded in ArcMap.  The input feature layer is exposed as parameter, but I have a default value set.  It worked fine may times, but now when I run it, I get a message that there are no records in the table (even though there are).  To make it work now, instead of using default or picking from list of ArcMap TOC items, I have to point the input to the feature class by loading the feature class directly in the tool interface (i.e. hitting the little folder icon and navigating to the where feature class is stored).  If I do that it works fine. he attached images show the simple model, model interface, and message I am getting.

This is happening in other cases where I have more complex models that have input as parameters, and that have pick lists of fields based on the selected feature class.  Im finding if I add fields to a certain layer and then run the model and pick the feature class, it does see the new fields.

It seems like something about the models is storing memory of previous runs related to feature layers loaded in the ArcMap document. I have tried closing out ArcMap sessions, cleaning temporary file locations, using MXD doctor, and similar.

Any input on what may be happening would be greatly appreciated!

Thanks

Neal

Simple Model

Simple Model Interface

Simple Model Error

6 Replies
DanPatterson_Retired
MVP Emeritus

export your model to a script so that it can be examined.

Modelbuilder is nice... but flakeyness can only be assessed by examining the underlying code.

Post here, using the syntax highlighting (python) by following the 3 dots ( . . .) on the toolbar of your reply, then past the code in

0 Kudos
DuncanHornby
MVP Notable Contributor

Neal,

I have 10.4.1 and experience similar issues. A geoprocessing tool simply stops accepting layers from the TOC and then you have to access the data from it's featureclass. In some cases I can live with that but other times I want to apply what ever I am doing on the selection, but if I can't access the layer then well...

The only solution to this behavior is to close down ArcMap and restart. Interestingly I have not observed this behaviour for some time so it makes me think it's some sort of compatibility issue with accessing tools/models/mxds that were created in 10.3..

0 Kudos
curtvprice
MVP Esteemed Contributor

I've been seeing this behavior also with 10.4.1. After ArcMap restart, models can see the layers again.

I'm really hoping it gets fixed in 10.5.

0 Kudos
DuncanHornby
MVP Notable Contributor

All,

This weird behaviour is manifesting itself again but I have tracked down when it occurs. It occurs after I have gone into the item description of a model/script tool and added some info (e.g. guidance on the parameters).

Then ANY geo-processing tool/model/script looses its ability to access layers in the mxd. Restarting ArcMap is the only option to continue...

0 Kudos
curtvprice
MVP Esteemed Contributor

I have repro' this behavior totally outside of model builder and have submitted an incident to Esri:

#01848371 ArcMap Tools do not recognize layers after metadata edit session

UPDATE: bug recorded (ArcGIS 10.4.1 [all data types] and ArcGIS 10.5 pre-release alpha 2 [gdb, not shapefile]

[BUG-000100572: Input drop down choices in geoprocessing tools are not available after editing or saving metadata.]

Here's my script to repro the problem with 10.4.1:

1. Open ArcMap
2. Add feature layer to map
3. Search for Copy Features tool and load dialog
4. Click on input, layers appear in pick list
5. In Catalog window, right click a feature class, open Item Description, Edit, save, exit
6. Search for Copy Features tool and load dialog
7. layers do NOT appear in pick list
8. Save map doc, restart Arcmap
9. Open Copy Features tool
10. Layers appear again in pick list

0 Kudos
curtvprice
MVP Esteemed Contributor

I have created a document about this issue and known fixes:

Missing Layer Pick Lists In Geoprocessing Tool Dialogs

0 Kudos