1

I keep getting this error from this line.

arcpy.CreateFishnet_management(os.path.join(Output_Folder, "Full_Grid.shp"), str(NAR_U9.extent.XMin) + " " + str(NAR_U9.extent.YMin), str(NAR_U9.extent.XMin) + " " + str(NAR_U9.extent.YMin + 10), Cell_Size_Width, Cell_Size_Height, "0", "0", str(NAR_U9.extent.XMax) + " " + str(NAR_U9.extent.YMax), "NO_LABELS", NAR_U9, "POLYLINE")

I can't seem to find anything online about what the 'unicode' part means. I'm giving it specific values for the coordinates for the corners so I don't understand where it's looking for an extent attribute.

  • Looking at ESRIs tool reference for CreateFishnet, I notice the datatype for the extent template is 'extent'. I have it as NAR_U9 which is a variable referenced to a shapefile. Shouldn't this work? – S. Price Aug 17 '18 at 17:20
1

Extent is accessed with Describe and the Extent function, for example:

import arcpy
fc = r'C:\path\file.shp'
desc = arcpy.Describe(fc)
xmin = desc.extent.XMin

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.