Python Script in Model Builder - Successful, but reports failure!

337
1
02-17-2012 10:37 PM
MatthewBarlow
New Contributor
This is a repost from the Python forum:

Hi,

I have a python script being initiated within model builder. It takes input and output parameters from modelbuilder and runs a series of raster analysis functions. It creates the layers, reports back to modelbuilder, says it completed successfully, but then finishes with the typical "Failed to execute" message. I have confirmed thelayers are created and contain expected results, but the model doesn't reflect success - ie, no drop shadows on the tool and outputs. These outputs need to hook into a following function, but it won't initiate because of the perceived failure...

I could post the code and such, but really I think this is something simple or a known issue that somebody must know about! Any ideas?

Thanks in advance,
Matthew
0 Kudos
1 Reply
JasonScheirer
Regular Contributor II
Are any of the Python tools using AddError() to put messages in the message box? Once a Python tool calls AddError(), the geoprocessor assumes that script failed.
0 Kudos