ArcGIS 10.1 Appending through Python

1056
4
08-14-2014 11:09 AM
DanielJohns
Occasional Contributor

I've built a model that is suppose to join and append those features onto a different dataset. It will work from ArcCatalog only once it's set to "NO_TEST" and the field mapping section is null. Once it's exported to a Python script it will not. I've tried the field mapping those fields and have verified that the field types match.

Any thoughts?

Thank you,

Daniel

0 Kudos
4 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Daniel,

Can you post your python script?  Here is a great link on how to do so using the new GeoNET.

0 Kudos
DanielJohns
Occasional Contributor

Please see attached, thank you.

0 Kudos
MichaelStead
Occasional Contributor III

I seem to remember fighting with field mapping for quite a while to get this to work, so I would just read some documentation on that or wait for someone who knows to respond, but I think you need to have a section in your code that sets up the field mappings.

0 Kudos
AlexanderNohe1
Occasional Contributor III

Hi Daniel,

First things first, is there any reason in particular that you would like this model to run in Python?

If you are looking to automate when the model is run, simply write a script that calls the model from Python.  This way, the model can still be run without you needing to worry about Python syntax as it seems that is the current issue.

An example for calling the script from Python would be the following:

import arcpy

arcpy.ImportToolbox(r"PYTHON_FILE_PATH", "MyToolbox")

arcpy.MyToolbox.ModelName

I would recommend doing the above rather than trying to troubleshoot the script that was created from ModelBuilder.

If you would like to continue trouble shooting the script that was created from modeulbuilder, what is the exact traceback error message that you get when you run the script?

I hope this helps!

Thanks!

Alexander N.