Solved! Go to Solution.
//refresh snap window UID extUid = new UIDClass(); extUid.Value = "esriEditor.SnappingWindow"; ISnappingWindow snapWindow = _editor.FindExtension(extUid) as ISnappingWindow; snapWindow.RefreshContents();
Use IFeatureSnapAgent2.HitType.
//refresh snap window UID extUid = new UIDClass(); extUid.Value = "esriEditor.SnappingWindow"; ISnappingWindow snapWindow = _editor.FindExtension(extUid) as ISnappingWindow; snapWindow.RefreshContents();
Be careful when using .ClearSnapAgents as it will delete them all which might not be what you want.
The other way to get the featuresnapagent for a layer is to loop through all agents (ISnapEnvironment.SnapAgentCount) then find the one you want by name.
Dont forget to refresh the snapping window after you have changed the snapagent properties.//refresh snap window UID extUid = new UIDClass(); extUid.Value = "esriEditor.SnappingWindow"; ISnappingWindow snapWindow = _editor.FindExtension(extUid) as ISnappingWindow; snapWindow.RefreshContents();