I am very new to Python.
I built a model in the ModelBuilder in a toolbox in ArcCatalog 10.3.1. I keep getting the following error about my buffer not being able to be executed and that my parameters are not valid. I set a field for a distance value for my buffer, my buffer, and a spatial join output as Model Parameters in my model builder before I exported the script to Python to run in Python IDLE:
Traceback (most recent call last): File "F:\Projects\Working\HurricanesSCRIPT.py", line 49, in arcpy.Buffer_analysis(Hurricanes_in_Counties, Hurricanes_Buffer, v15_Miles, "FULL", "ROUND", "NONE", "", "PLANAR") File "C:\Program Files (x86)\ArcGIS\Desktop10.3\ArcPy\arcpy\analysis.py", line 692, in Buffer raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 000725: Output Feature Class: Dataset F:\Projects\Working\ModelProject\ModelData.gdb\Hurricanes_Buffer already exists. Failed to execute (Buffer).
I have already put in arcpy.env.overwriteOutput = True
just below import arcpy
.
Here is the script for my arguments:
# Script arguments
v15_Miles = arcpy.GetParameterAsText(0)
if v15_Miles == '#' or not v15_Miles:
v15_Miles = "15 Miles" #15 Miles
Hurricanes_Counties_SpaJoi = arcpy.GetParameterAsText(1)
if Hurricanes_Counties_SpaJoi == '#' or not Hurricanes_Counties_SpaJoi:
Hurricanes_Counties_SpaJoi = "F:\\Projects\\Working\\ModelProject\\ModelData.gdb\\Hurricanes_Counties_SpaJoi" # provide a default value if unspecified
Hurricanes_Buffer = arcpy.GetParameterAsText(2)
if Hurricanes_Buffer == '#' or not Hurricanes_Buffer:
Hurricanes_Buffer = "F:\\Projects\\Working\\ModelProject\\ModelData.gdb\\Hurricanes_Buffer" # provide a default value if unspecified
And here is the script for my buffer:
# Process: Buffer
arcpy.Buffer_analysis(Hurricanes_in_Counties, Hurricanes_Buffer, v15_Miles, "FULL", "ROUND", "NONE", "", "PLANAR")
Hurricanes_in_Counties
? You have used this variable in yourarcpy.Buffer_analysis()
, but it is not defined in your arguments above.