AnsweredAssumed Answered

Model runs in ModelBuilder but gives error when run from Python Script

Question asked by nbanerjee on Apr 15, 2019
Latest reply on Apr 15, 2019 by curtvprice

Hello,

I have created a toolbox and developed a series of about 20 tools in ModelBuilder that represent different components of an analysis.  Each model runs fine without error when run in model building or executed in the Python command line within ArcMap.  Some of the models are fairly complex and involve iterators, in-line variables, etc.

 

I created a script tool with an associated Python script that basically runs all the component models in sequence.  Most of the models run fine, but a few that have iterators keep giving error when run through the Python Script tool.  The first model that the script chokes on involves an iterator with the 'Get Field Value' tool that then writes a value to a variable field name based on the get value value.  The values that  should be produced start at 2 and go to 500.  However, when I run Python script it for some reason returns a value of 1 and then bombs.  Again model run fine in model builder.   Below is an annotated screenshot of model.

 

Im stumped where/why it is return a value of 1.  Any ideas on why something in ModelBuilder works but not the identical process run from python script?  The input parameters and model reference work fine - so it is definitely something occurring within the model.  I cant imagine it is something in the script itself because it is just calling the model and the other models run fine.

 

Any help would be greatly appreciated

Thanks!

Neal

 

Outcomes