Tabbed feature inspector


Purpose
This sample demonstrates how to create a custom object inspector.
A custom object inspectors allows you to control the information that is returned to the user when selected features are inspected. The custom inspector calculates and reports the area and perimeter of selected polygons, the length and coordinates of selected lines, and the coordinates of selected points.
The custom information is shown in the second panel of a tabbed control. The first panel of the control shows the standard information for the feature.
The selected features must be from an object that supports both IFeatureClass and IClassSchemaEdit (see the Additional information section).

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 the solution and set EngineApplication as the startup project.
  2. Build the solution and run the application.
  3. Add point, polyline, and/or polygon feature class data to the map.
  4. Select a feature layer and use the Attach/Detach Tabbed Inspector Extension command.
  5. Confirm that the status bar at the bottom of the EngineApplication displays the Tabbed Inspector Extension as successfully attached to the selected feature class.
  6. Start editing, then choose one or more features from the selected feature class and open the Attribute dialog box.
  7. Ensure that a feature is selected in the Attribute dialog box tree. The Custom tab of the Attribute dialog box shows the output from the custom object inspector.

Additional information

The inspected features must be from an object that supports both IFeatureClass and IClassSchemaEdit. The Tabbed Feature Inspector is attached to a feature class using the feature class's IClassSchemaEdit interface. Classes that do not implement this interface, such as a shapefile class, cannot be used with this sample.
In addition, a feature class can have only one IFeatureClassExtension at a time, so some feature classes—such as annotation feature classes—cannot be used with this sample.
This sample can be adapted for use with an ObjectClass that is not displayed in the table of contents but that has a feature class extension.


EngineApplication/EngineApplication.cs The main application, implementing IApplicationServices.
TabbedInspector/AttachTabbedInspectorExtensionCommand.cs Attaches the custom inspector to the feature class selected in the table of contents.
TabbedInspector/TabbedInspector.cs An IEngineObjectInspector that displays custom information on the Attribute dialog box for each selected feature.
Download the C# files
EngineApplication/EngineApplication.vb The main application, implements IApplicationServices.
TabbedInspector/AttachTabbedInspectorExtensionCommand.vb Attaches the custom inspector to the feature class selected in the table of contents.
TabbedInspector/TabbedInspector.vb An IEngineObjectInspector which displays custom information on the Attribute dialog box for each selected feature.
Download the VB.NET files

Download the files for all languages




Additional Requirements
  • A geodatabase feature class containing either point, polyline, or polygon data is necessary to use this sample.

Development licensing Deployment licensing
Engine Developer Kit Engine
ArcGIS for Desktop Basic
ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced