I am trying to create a script tool in ArcGIS 10.2 in order to incorporate into a model. The script needs to incorporate three inputs which i've built using GetParameterAsText function then setting up the corresponding links within ArcGIS Script Tool Wizard.
However, when I run the script I get ERROR 000714 (see below). Not sure how to handle this error or why it isn't working to begin with.
import arcpy
inFC = arcpy.GetParameterAsText(0)
outFCName = arcpy.GetParameterAsText(1)
outFolder = arcpy.GetParameterAsText(2)
outFC = outFolder + "\\" + outFCName
try:
if arcpy.Exists(outFC):
arcpy.Delete_management(outFC)
arcpy.CreateFeatureclass_management(outFolder,outFCName,"POLYLINE","#","DISABLED","DISABLED",inFC)
arcpy.AddField_management(outFC,"inFID","LONG","#","#","#","#","NULLABLE","NON_REQUIRED","#")
iCursor = arcpy.da.InsertCursor(outFC, ["inFID","SHAPE@"])
print "Starting!"
with arcpy.da.SearchCursor(inFC,["OID@", "SHAPE@"]) as sCursor:
for row in sCursor:
inFID = row[0]
# Print the current multipoint's ID
#
# print("Feature {0}:".format(row[0]))
partnum = 0
# Step through each part of the feature
#
for part in row[1]:
# Print the part number
#
# print("Part {0}:".format(partnum))
# Step through each vertex in the feature
#
prevX = None
prevY = None
for pnt in part:
if pnt:
# Print x,y coordinates of current point
#
# print("{0}, {1}".format(pnt.X, pnt.Y))
if prevX:
array = arcpy.Array([arcpy.Point(prevX, prevY),
arcpy.Point(pnt.X, pnt.Y)])
polyline = arcpy.Polyline(array)
iCursor.insertRow([inFID,polyline])
prevX = pnt.X
prevY = pnt.Y
else:
# If pnt is None, this represents an interior ring
#
print("Interior Ring:")
partnum += 1
del iCursor
except Exception as e:
print e.message
arcpy.AddError(e.message)
print "Complete"
Here is the error:
Executing: SplitLines "F:\Extra Data\Prop Frontage\test_for_py.shp" tester.shp "F:\Extra Data\Prop Frontage"
Start Time: Thu Jan 23 11:38:46 2014
Running script SplitLines...
ERROR 000714: Error in script SplitLines.
Error in executing: cmd.exe /C F:\MASTER~2 "F:\Extra Data\Prop Frontage\test_for_py.shp" "tester.shp" "F:\Extra Data\Prop Frontage"
Failed to execute (SplitLines).
Failed at Thu Jan 23 11:38:46 2014 (Elapsed Time: 0.16 seconds)
outFC = outFolder + outFCName
beoutFC = outFolder + "\\" + outFCName
and come after theGetParameterAsText(2)
line?