Area/Perimeter Inspector


Custom Object Inspectors allow you to control what information is returned to the user when selected features are inspected. This sample demonstrates how to create a custom Object Inspector using VB 6. The custom inspector calculates and reports the area and perimeter for the selected polygons, length and coordinates for selected lines, and coordinates for selected points. It also reports the total number of selected features.

How to use:
  1. Register ObjectInspector.dll located in the samples directory.
  2. Run REGEDIT from the Start menu. Navigate to HKEY_CLASSES_ROOT\CLSID and then use the Find utility under the Edit Menu to search for the object inspector's CLSID. Enter the ProgID 'ObjectInspector.clsObjectInspector' in the search field. The CLSID should look like this: {1B846C37-A66D-11D3-BC83-0080C7458371}. Note: When building your own custom inspector, make sure Binary Compatability is set on the Project Properties Compile tab. This will ensure the same GUID is used each time you compile the project.
  3. Open any personal geodatabase (.mdb) in Access. In the ObjectClasses table, add the CLSID from above in the EXTCLSID column of all feature classes. When you select features belonging to any feature class, the custom feature inspector will be used to inspect the features.
  4. Start ArcMap and add the Editor toolbar. Add the data from above to the Map.
  5. Start an edit session and use the Edit tool to select several polygons.
  6. Click on the Attributes tool in the Editor toolbar to bring up the Attributes Dialog. The custom inspector should appear in the right window of the Attributes Dialog whenever you inspect features belonging to the customized feature class. The default feature inspector will show up for features belonging to any other feature class added to the map.
  7. Click on a single Feature ID (FID) in the tree view and its properties are reported.


Requires: An edit session.

Difficulty: Intermediate

Visual Basic
File Description
ObjectInspector.cls Class file demonstrating how to build a custom inspector.
frmInspect.frm Customized form seen in the right pane of the inspector.
ObjectInspector.vbp The project file.
ObjectInspector.dll The compiled project.

Key CoClasses: FeatureInspector
Key Interfaces: IObjectInspector, IClassExtension, IArea, ICurve
Key Members: IObjectInspector::Inspect, IArea::Area, ICurve::Length