Custom Sketch Tool


This code demonstrates how to encapsulate an existing tool and pass through calls to that tool. By encapsulating another tool you can override just the behavior you are interested in changing. In this example, the functionality of the Editor sketch tool is encapsulated into a custom tool. All calls are passed through (no custom behavior), but the code demostrates the process.

How to use:
  1. Start ArcMap, add some layers to the map, and begin editing.
  2. Browse and select the CustomSketch.dll using the 'Add From File' button on the customization dialog.
  3. From the 'Developer Samples' commands category, add the 'Custom Sketch Tool' command to an existing toolbar.
  4. Select this tool and use it in place of the Edit Sketch Tool.


Requires: Editable layers

Difficulty: Advanced

Visual Basic
File Description
frmResources.frm Form containing icon for the tool.
SketchTool.cls Class duplicating sketch tool behavior.

Key CoClasses: SketchTool
Key Interfaces: ISketchTool