gridIndexFeature in python

250
1
05-25-2012 03:32 PM
nimitz
by
Occasional Contributor
Hey all,
I'm trying to use the examples in ARCGIS 10 in the Cartography toolbox to create an index grid for a project. I've tried in the Python window in the Arcview map that I'm using. This example is from the online help. I'm using example 4 (I think it's the easiest). Here is my code:
>>>import arcpy
>>> from arcpy import env
>>> arcpy.env.workspace = "C:\GIS_Data\Conversions\West.shp"
>>>arcpy.GridIndexFeatures_cartography("gridIndexFeatures", "", "", "", "",
                                                   "1000 meters", "1000 meters",
                                                   "-13511019.861", "4649745.391",
                                                   "20", "20")

Here is my error.
"Runtime error <class 'arcgisscripting.ExecuteError'>: ERROR 000622: Failed to execute (Grid Index Features). Parameters are not valid. ERROR 000628: Cannot set input into parameter origin_coord."

I think it's the input origin coordinate, BUT I looked on the dataview and put my cursor pretty close to where I needed. I tried switching the x,y position and nothing either.

This is NOT my preferred coordinate system, but I'd like to use this dataset anyways. I just needed to make a 20x20 grid about 1000m in dimensions.

I'd prefer to do this in Python Win or IDLE, but that's not working either.

Any help is appreciated.
Tags (2)
0 Kudos
1 Reply
KimOllivier
Occasional Contributor III
Open the tool and run it interactively. After it has run, open up the results and right-click to 'Copy as python snippet' to get a successful command to paste into a script as a template.
0 Kudos