This document is archived and information here might be outdated.  Recommended version.

Editor (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Editor


Supported with:
  • ArcGIS for Desktop Basic
  • ArcGIS for Desktop Standard
  • ArcGIS for Desktop Advanced
Library dependencies: Version, System, SystemUI, Geometry, GraphicsCore, Display, Server, Output, Geodatabase, GISClient, DataSourcesFile, DataSourcesGDB, DataSourcesOleDB, DataSourcesRaster, DataSourcesNetCDF, GeoDatabaseDistributed, GeoDatabaseExtensions, Carto, NetworkAnalysis, Location, GeoAnalyst, Animation, Maplex, Geoprocessing, NetworkAnalyst, Schematic, SpatialAnalyst, 3DAnalyst, GlobeCore, EngineCore, TrackingAnalyst, Framework, Desktop.Addins, GeoDatabaseUI, DisplayUI, OutputUI, Search, Catalog, CatalogUI, CartoUI, DataSourcesRasterUI, ArcCatalog, ArcCatalogUI, ArcMap, ArcMapUI, AnimationUI

Additional library information: Contents, Object Model Diagram

The Editor library implements the ArcMap object editor. The Editor library supports the editing of simple features, network features, annotations, and topological features, as well as attributes for these features. This library supports both a user interface (UI) and an application programming interface (API). The API provided by the Editor library is a higher level API than that of the Geodatabase library. Developers are encouraged to use the Editor API when editing and manipulating features in the geodatabase.
This topic provides an overview of the Editor library and its significant subsystems. For information on using the library when developing editing customizations and solutions for ArcGIS Desktop, see ArcGIS Desktop editing for developers. If you're developing an editing customization using ArcGIS Engine, see ArcGIS Engine editing.

See the following sections for more information about this namespace:

Editor object

The primary object in the editor framework is the Editor object. The interfaces on the editor maintain the editing environment including the edit session, editable layers, feature templates, editing options, edit events, and the editor snapping environment.
The Editor object is an ArcMap extension and can be obtained by either the IApplication.FindExtensionByName or IApplication.FindExtensionByCLSID method.
The following code example shows how to obtain the Editor object. You must have a reference to the editor assembly in your integrated development environment (IDE).
'Get the editor extension.
Dim editorUID As UID
editorUID=New UID
Dim editor As IEditor3
//Get the editor extension.
UID editorUID=new UID();
IEditor3 editor=application.FindExtensionByCLSID(editorUID)as IEditor3;
How you obtain a reference to IApplication depends on whether you're creating an add-in or a component. For more information, see Introduction to desktop editing for developers.

Editing environment

The methods on IEditor3 are used to maintain the edit session, while its properties return information about the session itself such as the edit state, selection set, and current workspace. This interface also manages the template environment. For information on managing the edit session, see Managing edit sessions and edit operations. For information on working with templates, see Using feature templates.
The properties on IEditProperties4 reflect most of the options found on the Editor Options dialog box.

Current layer

The editor target or current layer is used to determine which layer to apply an edit to. This is set behind the scenes by the template environment and most of the editor commands and tools via template pickers. The properties and methods on IEditLayers are used to maintain the current layer.

Edit sketch

The properties and methods on IEditSketch3 maintain the edit sketch. Edit tasks and most customizations using the edit sketch will query and perform edits with the sketch geometry, obtained from IEditSketch3.Geometry. You can also constrain the edit sketch to a particular geometry type using IEditSketch3.GeometryType, which will enable those corresponding shape constructors. For more information, see Working with the edit sketch.

Editor snapping environment

The editor maintains a separate snap environment (in addition to the ArcGIS snapping environment available in ArcGIS Desktop and Engine) via the ISnapEnvironment3 interface. For most customizations however, the ArcGIS snapping environment is more appropriate.
For more information on snapping options and how to use snapping in your customizations, see Snapping in ArcGIS.

Editor events

The editor exposes numerous events allowing customizations to respond to changes in the editor environment, templates, and the sketch. These events are located on the IEditEvents5 interface. For more information on working with edit events, see Working with editing events.

Feature inspectors

The ArcMap Attributes dialog box contains two panels. The feature panel lists the map features that have been selected and are editable. The features are listed under the feature class to which they belong. Any related features are also listed in this panel under the selected feature to which they are related. The attribute panel contains a feature inspector.
ArcMap ships with a standard feature inspector that enables attribute editing. For any feature class in a geodatabase, you can replace the default feature inspector with a custom feature inspector. For example, you can create a custom feature inspector that displays a bitmap whenever a feature belonging to a specific feature class is selected.
Create custom inspectors by implementing the IObjectInspector interface and registering the class as a feature class extension. Custom feature inspectors can only be assigned to feature classes in a geodatabase. Only one feature inspector can be active for each feature class. When you create a custom feature inspector, you specify the specific feature classes that will use it. Selecting a feature in the feature panel of the Attributes dialog box activates the associated feature inspector in the attributes panel.
For an example of a custom feature inspector, see Tabbed feature inspector.

Annotation and dimension constructors

Annotation constructors provide specialized behavior for creating new annotation features, while dimension constructors provide specialized behavior for creating new dimension features.
  • Annotation constructors
    Annotation constructors use edit sketch extensions to create new geodatabase annotation features. An annotation constructor controls the display feedback you see when creating a new annotation feature, and it constrains the construction in a certain way. For example, when constructing an annotation feature, you can control the number of points that must be entered before the construction can finish, or if existing vertices can be deleted. Annotation constructors use pre-sketch feedback to display text before the initial point is added to the sketch. Annotation constructors must implement the IAnnotationConstructor interface and be registered in the ESRI Annotation Constructors component category.
  • Dimension constructors
    Dimension constructors use edit sketch extensions to create new dimension features. A dimension constructor controls the display feedback you see when creating a dimension feature and constrains the construction in a certain way. Dimension constructors must implement the IDimensionConstructor interface and be registered in the ESRI Dimension Constructors component category.