Select to view content in your preferred language

Is it possible to use the grid index tool from a python script?

165
1
a month ago
rescobar
Occasional Contributor

I have the following code to try to create a grid index. I want to be able to add in a scale field. However, whatever layout I have open, it doesn't seem to be picking up the page units. It ends up creating one huge index page (over 70 miles in height)

 

 

Layer = arcpy.GetParameterAsText(0)
Scale = arcpy.GetParameterAsText(1)
out_location = arcpy.GetParameterAsText(2) 
arcpy.cartography.GridIndexFeatures(out_feature_class=out_location+"//index", in_features=Layer, use_page_unit="USEPAGEUNIT", polygon_width = "9.88", polygon_height= "13.62", scale = Scale, intersect_feature = "INTERSECTFEATURE")

 

Tags (3)
0 Kudos
1 Reply
DuncanHornby
MVP Notable Contributor

Have you read the usage section of the tool help? That explains how the tool functions under what scenarios.

0 Kudos