ArcGIS 10.0 & PythonWin 2.6.5 - RuntimeError:: Object in executing tool

1564
0
09-19-2012 12:08 PM
ScottChang
New Contributor II
Hi all,

In my ArcGIS 10.0 & PythonWin 2.6.5, I ran the following ArcPy-Python script:
>>> coordList = [[[1, 2], [2, 4], [3, 7]],
...             [[6, 8], [5, 7], [7, 2], [9, 5]]]
>>> point = arcpy.Point()
>>> array = arcpy.Array()
>>> featureList = []
>>> for feature in coorList:
...  for coordPair in feature:
...   point.X = coordPair[0]
...   point.Y = coordPair[1]
...   array.add(point)
...  array.add(array.getObject(0))
...  polygon = arcpy.Polygon(array)
...  array.removeAll()
...  featureList.append(polygon)
... arcpy.CopyFeatures_management(featureList, "c:/TEMP/PythonWin265/polygons2.shp")
Traceback (  File "<interactive input>", line 10
    arcpy.CopyFeatures_management(featureList, "c:/TEMP/PythonWin265/polygons2.shp")
        ^
SyntaxError: invalid syntax
>>> arcpy.CopyFeatures_management(featureList, "C:/TEMP/PythonWin265/polygons.shp")
Traceback (most recent call last):
  File "<interactive input>", line 1, in <module>
  File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\management.py", line 1943, in CopyFeatures
    raise e
RuntimeError: Object: Error in executing tool
>>> 

I have no ideas what is wrong in my script.  Please kindly help and advise me how to fix this problem.

Thanks,
Scott Chang
Tags (2)
0 Kudos
0 Replies