Add Shapefiles Command


This command allows the user to browse for Shapefiles. The selected Shapefiles are added to the active data frame of the ArcMap application. The standard windows explorer file selector is used to locate this Shapefiles; hence browsing is very much quicker than the standard Add Data dialog.

How to use:
  1. In the Customize dialog, click on 'Add from file' and select this sample's dll.
  2. Under the Commands tab of the Customize dialog, select the Add Shapefiles command from the 'Developer Samples' category, and drag it on to a toolbar. Dismiss the Customize dialog.
  3. Click on the command and browse to shapefiles.


Difficulty: Intermediate

Visual Basic
File Description
clsAddShapefile.cls Class file that implements the COM Server.
frmResources.frm VB Form file holding resources used within project.
AddShapeFIle.vbp VB Project File for sample.
AddShapeFile.dll Compiled project DLL.
AddData.bmp Bitmap used by the command button.

Key CoClasses: ShapefileWorkspaceFactory, FeatureLayer, FeatureClass
Key Interfaces: IWorkspaceFactory, IFeatureWorkspace, IFeatureClass, IGeometry, IFeatureLayer