Python Script in Model Error 000800

762
2
07-03-2018 06:35 AM
MBGear
by
New Contributor

Hello! I am having an issue with a model I built in #modelbuilder Essentially what the model does is it takes a file geodatabase and a script iterates through the FGDB to determine if a specific feature class exists or not. If the feature class exists, the model appends that feature class to an existing master feature class. If the feature doesn't exist, the model will just skip over appending that feature. When I open up the model in ModelBuilder and drag and drop the FGDB into it, it works perfectly fine. However, when I double-click on the tool to open up the window where you just enter in the parameters I get the following Error000800 message.

 

I'm assuming it is an error with my #python script. But since I'm not well versed in Python I have no idea what I'd need to do to fix the issue. My script just goes through checking for the existence of 13 different feature classes using the if/elif/else iterator. Its super simple and like I said before, works just fine when the model is open in ModelBuilder.

Here is the beginning of the script:

It then will iterate through 10 more feature classes before ending:

I am trying to make my tool easier for others to use by only requiring them to double-click and enter in the required parameters in a dialog box instead of having to open up the model and possibly mess something up. Any suggestions on how to fix this would be helpful.

0 Kudos
2 Replies
curtvprice
MVP Esteemed Contributor

I think your problem is the Append tool field map, which is not updated at runtime if the model is run as a tool. (In edit mode the field map gets updated when you drag the fgdb onto the model element.) Do you need to append using NO_TEST (which requires a current field map)?  

If you need NO_TEST, the workaround involves some python 

Field Mappings variable as a parameter not working in 10.5.1

MBGear
by
New Contributor

I'm still working on getting this to work but from reading the other post and other things about this issue, I'm fairly certain this is the issue. It may take me a while to get the script working but I'll update once I do. 

Thanks!

0 Kudos