Custom subtyped command and tool


Purpose
You can create multiple commands or tools with similar functionalities in a single class by implementing ICommandSubType. The primary purpose of this sample is to illustrate how to create a single subtyped command that behaves and appears like multiple commands.

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 sample project in Visual Studio. Set up a debug application if needed.
  2. The ZoomInCommands class works in ArcMap, ArcScene, or ArcGlobe. Drag and drop the Fixed zoom in x# (C#) or Fixed zoom in x# (VB .NET) command under the .NET Samples category on the Customize dialog box onto the application.
  3. Click the command to perform the fixed zoom in at various levels. If necessary, add data to verify each command is zooming at a different level.
  4. The PolyFeedbackTools class works in ArcMap only. Drag and drop the # sides feedback (C#) or # sides feedback (VB .NET) tool from the .NET Samples category on the Customize dialog box onto the application.
  5. Click to activate the feedback tool and click the map to start a polygon display feedback. The display feedback automatically finishes when the shape has reached the number of sides limit of the tool. The status bar also reports the area of the tracked polygon.

Additional information

This sample contains a command class called ZoomInCommands that implements three subtyped commands performing different levels of fixed zoom in, and a tool class called PolyFeedbackTools that implements three subtyped tools tracking different kinds of polygon display feedback (3- to 5-sided).


PolyFeedbackTools.cs Subtyped tools tracking multisided display feedback (ArcMap only).
ZoomInCommands.cs Subtyped commands with different levels of fixed zoom in (ArcMap, ArcGlobe, or ArcScene).
Download the C# files
PolyFeedbackTools.vb Subtyped tools tracking multisided display feedback (ArcMap only).
ZoomInCommands.vb Subtyped commands with different levels of fixed zoom in (ArcMap, ArcGlobe, or ArcScene).
Download the VB.NET files

Download the files for all languages

See Also:

How to create multiple commands or tools in a single class subtyped command
Sample: Recently used files—Command, MultiItem, and ComboBox




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