ArcObjects Library Reference  (Editor)    

ISnapEnvironment Interface

Provides access to members that manage the snap agents used by the editor.

Product Availability

Available with ArcGIS Desktop.

When To Use

The ISnapEnvironment interface manages the collection of snap agents,
the snap tolerance, and the snap tolerance units

Members

Description
Method AddSnapAgent Adds a new snap agent to the snap environment.
Method ClearSnapAgents Removes all snap agents.
Method RemoveSnapAgent Removes the snap agent at the given index.
Read-only property SnapAgent A snap agent at the given index.
Read-only property SnapAgentCount The number of active snap agents.
Method SnapPoint Attempts to snap the point using the current snap environment.
Read/write property SnapTolerance The snap tolerance, measured in pixels or map units.
Read/write property SnapToleranceUnits The units used for the snap tolerance.

CoClasses that implement ISnapEnvironment

CoClasses and Classes Description
Editor The Object Editor Extension.

Remarks

The ISnapEnvironment interface is on the Editor CoClass. You can access ISnapEnvironment from any other interface on the Editor CoClass.

[C#]

To use this code to access the ISnapEnvironment interface first get a reference to Iapplication(app) thru the ICommand::OnCreate hook parameter.


  IEditor sEditor;
  sEditor = app.FindExtensionByName("ESRI Object Editor") as IEditor;
  ISnapEnvironment snapEnv = sEditor as ISnapEnvironment;

[Visual Basic 6.0]

The following VBA code excerpt shows an example of this.

Dim pApp As IApplication 
Dim pEditor As IEditor 
Dim pSnapEnv As ISnapEnvironment 
Dim pID As New UID 
pID = "esriEditor.Editor" 
Set pApp = Application 
Set pEditor = pApp.FindExtensionByCLSID(pID) 
'QI for ISnapEnvironment 
Set pSnapEnv = pEditor 

See Also

IDatasetEdit Interface | IDatasetEditInfo Interface | IEditEvents2 Interface | Editor Class | IEditTask.OnDeleteSketch Method | IEditor Interface | IEditEvents Interface | IEditTask.OnFinishSketch Method | IEditProperties Interface | ISnapEnvironment Interface | IEditTask.Deactivate Method | IEditAttributeProperties Interface | IEditTask.Activate Method | IEditLayers Interface | IEditTask.Name Property | IEditSketch Interface | ISnapAgent Interface | esriSnapToleranceUnits Constants

 


Feedback Send feedback on this page