I have a script that tries to read from the arc environment using
import arcpy
tolerance = arcpy.env.XYTolerance
as recommended here: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000000w000000
Alas tolerance
always ends up as None
. Even when I set it explicity in the Environments...
part of the script dialog box.
Is this a bug?
1 Answer 1
I have loaded up arcmap and using the built in python interpreter I ran through the commands outlined in the helpfiles you linked. It seems that the syntax is very precise, but I was able to set the tolerance and then retrieve it as a variable called tolerance
using the following steps:
>>> import arcpy
>>> from arcpy import env
>>> env.workspace = 'C:\\shapefiles\\final'
>>> env.XYTolerance = 2.5
>>> tolerance = env.XYTolerance
>>> print tolerance
2.5 Unknown
>>>
-
Ok... but how to retrieve
XYTolerance
from the script dialog box? Which workspace does that live in?Sideshow Bob– Sideshow Bob2012年10月17日 14:54:39 +00:00Commented Oct 17, 2012 at 14:54