Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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, or am I barking up the wrong tree?

share|improve this question

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
>>> 
share|improve this answer
    
Ok... but how to retrieve XYTolerance from the script dialog box? Which workspace does that live in? –  Sideshow Bob Oct 17 '12 at 14:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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