For some graph work, I need the value of X,y tolerance. I found ISpatialReferenceTolerance.XYTolerance Property. But I couldn't find any option that how can I get ISpatialReferenceTolerance interface from the map? Can anybody give me some pointer?

1 Answer 1

    double GetXyTolerance()
        var map = ArcMap.Document.FocusMap;
        var spatialRef = map.SpatialReference;
        if (spatialRef!=null && spatialRef.HasXYPrecision())
            var spRefTolerance = spatialRef as ISpatialReferenceTolerance;
            if (spRefTolerance != null && spRefTolerance.XYToleranceValid == esriSRToleranceEnum.esriSRToleranceOK)
                return spRefTolerance.XYTolerance;
        return -1.0;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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