Create a custom tool


PurposeThis sample demonstrates how to create a tool. Tools are commands that enable the user to interact with map and page layout documents. The tool is created by inheriting the BaseTool class from ESRI.ArcGIS.ADF.Local. This sample contains the code demonstrated in the walkthrough, Create a custom tool.

How to use

See How to use ArcGIS samples for help on compiling, setting up the debugger, and running the sample. If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

  1. Open and compile the solution.
  2. Start ArcMap.
  3. Click on Customize menu and choose Customize mode… to open the Customize dialog box. Scroll down to the Walkthroughs section in the Commands tab's Categories pane.
  4. In the Commands pane, click and drag the Draw Graphic Line command on to the ArcMap graphical user interface (GUI). Close the Customize dialog box.
  5. Click the added tool to activate it, click the map window in ArcMap to anchor the first point of the line, move the mouse pointer and click again (repeat as necessary), then double-click to end the line added as a graphic in the active view.

DrawGraphicLine.cs Demonstrates how to draw graphic lines in the map window of ArcMap.
Download the C# files
DrawGraphicLine.vb Demonstrates how to draw graphic lines in the map window of ArcMap.
Download the VB.NET files

Download the files for all languages

See Also:

Walkthrough: Create a custom tool
Creating commands and tools




Development licensing Deployment licensing
ArcGIS for Desktop Basic ArcGIS for Desktop Basic
ArcGIS for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced