import arcpy cur = arcpy.InsertCursor("c:/PY123.shp") point = arcpy.Point() array = arcpy.Array() for x in range(2): for y in range(1): point.X = x point.Y = y array.add(point) point.X = x+1 point.Y = y array.add(point) point.X = x+1 point.Y = y+1 array.add(point) point.X = x point.Y = y+1 array.add(point) point.X = x point.Y = y array.add(point) array.add(array.getObject(0)) feat = cur.newRow() feat.setValue("Col", x) feat.setValue("Row", y) feat.shape = arcpy.Polygon(array) cur.insertRow(feat) array.removeAll() del cur
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.