I have been trying to use python to create a custom polygon layer that represents the extents of all the maps I wish to create...
I have about 60 extents, and when I run the script, it comes up with this error:
for bkmk in arcpy.mapping.ListBookmarks(mxd):
array.add(arcpy.Point(bkmk.extent.XMin, bkmk.extent.YMin))
array.add(arcpy.Point(bkmk.extent.XMin, bkmk.extent.YMax))
array.add(arcpy.Point(bkmk.extent.XMax, bkmk.extent.YMax))
array.add(arcpy.Point(bkmk.extent.XMax, bkmk.extent.YMin))
# To close the polygon, add the first point again
array.add(arcpy.Point(bkmk.extent.XMin, bkmk.extent.YMin))
cur.insertRow([arcpy.Polygon(array), bkmk.name]) #this is line 33
array.removeAll()
Runtime error
Traceback (most recent call last):
File "<string>", line 33, in <module>
RuntimeError: The row contains a bad value. [Name]
It does create a layer called Bookmarks and does produce 24 of the 60 polygons, but no more.
Any ideas?
Thanks