nimitz

Setting Environment Settings

Discussion created by nimitz on May 29, 2012
Latest reply on Jun 1, 2012 by nimitz
Hi all,
I'm trying to wrap my head around a small script to create a Grid Index. Looking at the examples in the ArcGIS 10 help, setting the environment is messing up my script.
>>> ###GridIndexFeatures 
>>> ###import system modules
>>> import arcpy
>>> from arcpy import env
>>> 
>>> ###Set environment settings
>>> arcpy.env.workspace = "C:\Users\RLong\Documents\WestJackson.mdb"
>>> 
>>> ###Set Local Variables
>>> outFeatureClass = "gridIndexFeatures"
>>> inFeatures = "myGrid"
>>> polygonWidth = "1000 feet"
>>> polygonHeight = "1000 feet"
>>> 
>>> ###Execute GridIndexFeatures
>>> arcpy.GridIndexFeatures_cartography("grid", "WestJackson.mdb", "", "", "",
...      "1000 feet", "1000 feet")


My error code is:
Traceback (most recent call last):
  File "<interactive input>", line 2, in <module>
  File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\cartography.py", line 787, in GridIndexFeatures
    raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Features: Dataset WestJackson.mdb does not exist or is not supported
ERROR 000398: Value must be positive
ERROR 000398: Value must be positive
ERROR 000892: The numeric value is outside of the valid range.
ERROR 000892: The numeric value is outside of the valid range.
Failed to execute (GridIndexFeatures).

The input features Dataset WestJackson.mdb does not exist or is not supported. This is curious b/c I have the database which has 2 personal geodatabase features "in it".

Can't I use the database WestJackson.mdb? Or do I have to use one of the file geodatabases that are in WestJackson.mdb?

Any help is appreciated. I am using PythonWin 2.6 and trying to save the scripts, but the script will automatically run after I input the last line,

Outcomes