AnsweredAssumed Answered

Problem with Z snapping

Question asked by viko18 on Aug 17, 2016


I am implementing own extension for Z snapping.

I have followed an example on arcgis site:


My problem is, the Z snapping is not working on another PCs.

It only works on my machine. And I noticed, when I change pixels to map units in snapping tolerance or I set properties SnapZTolerance and UseSnapZTolerance=true, it stop working on my PC too.


I also tested Z Management Toolbar, but it is not working.


Thanks for any advice.


My system:

Windows 8.1 Pro SK

ArcGIS 10.4 for Desktop

ArcGIS 10.4 for Desktop Runtime Error R6034 Patch

ArcGIS 10.4 for Desktop ModelBuilder Regional Language Display Patch

ArcObjects SDK for the Microsoft .NET Framework 10.4.5524

Visual Studio 2013


Example code:

private void EnableZSnapping(IEditor editor)
    ISnapEnvironment3 snapEnvironment = (ISnapEnvironment3)editor;


    for (int i = snapEnvironment.SnapAgentCount - 1; i >= 0; i--)
        ISnapAgent snapAgent = snapEnvironment.get_SnapAgent(i);
        var featureSnapAgent = snapAgent as IFeatureSnapAgent2;


        if (featureSnapAgent == null)


        featureSnapAgent.HitType = ESRI.ArcGIS.Geometry.esriGeometryHitPartType.esriGeometryPartBoundary
            | ESRI.ArcGIS.Geometry.esriGeometryHitPartType.esriGeometryPartVertex
            | ESRI.ArcGIS.Geometry.esriGeometryHitPartType.esriGeometryPartEndpoint
            | ESRI.ArcGIS.Geometry.esriGeometryHitPartType.esriGeometryPartMidpoint;


        IFeatureClass featureClass = featureSnapAgent.FeatureClass;
        IGeometryDef geometryDef = GetGeometryDef(featureClass);
        if ((geometryDef != null) && geometryDef.HasZ)
            featureSnapAgent.ZSnappingEnabled = true;