In this topic
- Editor customizations and deployment options
- Creating an editor command add-in
- Creating an editor tool add-in
- Creating an editor extension add-in
Editor customizations and deployment options
The editing framework can be customized to add your own commands, tools, tasks, extensions, shape constructors, and object inspectors. For an overview of these customizations, see ArcGIS Desktop editing for developers.
Many of these customizations can be built and deployed as add-ins, while others require development of custom components. For more information on customizing using add-ins, see Building add-ins for ArcGIS Desktop. For information on how to create editor customizations using components, see Editor framework customizations. For general information on components, see Extending ArcObjects.
Developing and deploying your customizations as add-ins is the preferred method.
The following table shows the various editor customization types and their supported customization methods:
Customization type
|
Add-in
|
Component
|
Commands
|
Yes*
|
Yes
|
|
No
|
Yes
|
Tools
|
Yes**
|
Yes
|
|
No
|
Yes
|
Tasks
|
No
|
Yes
|
Extensions
|
Yes*
|
Yes
|
Shape constructors
|
No
|
Yes
|
Object inspectors
|
No
|
Yes
|
Snap agents
|
No
|
Yes
|
Edit sketch extensions
|
No
|
Yes
|
* Cannot implement additional interfaces.
** Cannot implement additional interfaces or use shape constructors.
Any editor customization that requires you to implement an interface outside the framework or that requires registering with an editor component category needs to be created as a Component Object Model (COM) component.
Creating an editor command add-in
Creating an editor command add-in follows the same workflow as creating a regular ArcGIS command add-in. A reference to the editor is obtained in the add-in constructor. To enable the command while editing, set the Enabled property in the OnUpdate method. See the following code example:
[C#]
public class EditCommand: ESRI.ArcGIS.Desktop.AddIns.Button private IEditor3
m_Editor;
public EditCommand()
{
//Get the editor extension.
UID uID = new UIDClass();
uID.Value = "esriEditor.Editor";
m_Editor = ArcMap.Application.FindExtensionByCLSID(uID)as IEditor3;
}
protected override void OnUpdate()
{
Enabled = (m_Editor.EditState == esriEditState.esriStateEditing);
}
[VB.NET]
Public Class Button1
Inherits ESRI.ArcGIS.Desktop.AddIns.Button
Dim m_Editor As IEditor3
Public Sub New()
'Get the editor extension.
Dim editorUID As UID
editorUID = New UID
editorUID.Value = "esriEditor.Editor"
m_Editor = (My.ArcMap.Application.FindExtensionByCLSID(editorUID))
End Sub
Protected Overrides Sub OnUpdate()
Enabled = (m_Editor.EditState = esriEditState.esriStateEditing)
End Sub
The Curve conversion add-in is an example of an editor command add-in.
Creating an editor tool add-in
If you need a simple tool that provides its own feedback, geometry, or map selection, you can create your edit tool as an add-in. Add-ins cannot implement other interfaces nor can they be used to create construction tools.
For information on how to build a tool add-in, see Building custom UI elements using add-ins. As with command add-ins, you'll have to put the editor initialization in the tool add-in constructor and check for the edit state in the OnUpdate method.
Creating an editor extension add-in
For information on using add-ins to create editor extensions, see Building editor extensions using add-ins.
See Also:
ArcGIS Desktop editing for developersEditor framework customizations
To use the code in this topic, reference the following assemblies in your Visual Studio project. In the code files, you will need using (C#) or Imports (VB .NET) directives for the corresponding namespaces (given in parenthesis below if different from the assembly name):
Development licensing | Deployment licensing |
---|---|
ArcInfo | ArcInfo |
ArcEditor | ArcEditor |
ArcView | ArcView |