1

I am calling a number of files that I want to clip etc in ModelBuilder which clips data and sends it to a specific feature class.

I want to re-run that same process for which I have converted the model to python and I am calling from Scheduled task in Windows 7 to update data in an application that staff use.

What I would like to know is if the feature classes I am clipping have changed, will it automatically do the clip, or do I have to delete the feature classes that have already been created first, and then re-do the Clip?

1

Without seeing the model or the exported Python script it is hard to say this definitively but ...

If you have the line below in your Python script:

arcpy.env.overwriteOutput = True

then it should take care of ensuring that what you try to write can be written.

Alternatively, you could use two lines like the following to ensure that the outputFC does not exist prior to trying to write it out from the Clip.

if arcpy.Exists(outputFC):
    arcpy.Delete_management(outputFC)

If the above advice does not resolve it then be sure to use the edit button to include within your question a code snippet from the Python script that you are scheduling as a task.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.