>>> import arcpy >>> pointA = arcpy.Point(2.0, 4.5) >>> pointB = arcpy.Point(3.0, 7.0) >>> print pointA 2 4.5 NaN NaN >>> print pointB 3 7 NaN NaN >>>
>>> 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 coordList: ... for coordPair in feature: ... point.X = coordPair[0] ... point.Y = coordPair[1] ... array.add(point) ... polyline = arcpy.Polyline(array) ... array.removeAll() ... featureList.append(polyline) ... arcpy.CopyFeatures_management(featureList, "c:/TEMP/PythonWindow10_0/polylines.shp") ... >>> arcpy.env.workspace=r'c:\TEMP\PythonWindow10_0' >>> inFC='polylines.shp' >>> outFC='polylinesArcPy.shp' >>> arcpy.CopyFeatures_management(inFC,outFC) <Result 'c:\\TEMP\\PythonWindow10_0\\polylinesArcPy.shp'> >>> # To create polygon by using the existing points >>> for feature in coordList: ... for coordPair in feature: ... point.X = coordPair(0) ... point.Y = coordPair(1) ... array.add(point) ... array.add(array.getObject(0)) ... polygon = array.Polygon(array) ... array.removeAll() ... featureList.append(polygon) ... arcpy.CopyFeatures_management(featureList, "c:/TEMP/PythonWindow10_0/polygons.shp") ... Runtime error <type 'exceptions.TypeError'>: 'list' object is not callable
... point.X = coordPair(0) ... point.Y = coordPair(1)
... point.X = coordPair[0] ... point.Y = coordPair[1]
>>> import arcpy >>> 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 coordList: ... 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.apend(polygon) ... arcpy.CopyFeatures_management(featureList, "c:/TEMP/PythonWindow10_0/polygons.shp" ... Parsing error <type 'exceptions.SyntaxError'>: invalid syntax (line 17) >>>
You spelled append wrong