by Ishara Kotiah, Senior GIS Consultant
One of the common complaints from users migrating from Arcview 3 to ArcGIS 8 is the loss of basic tools, like the ability to sketch a polygon on screen and display its area or a single button on the interface to zoom to selected features in the active layer. In ArcGIS 8 this is a three-button operation:
- a right click on the layer in the Table of Contents
- a click on the Selection Sub Menu
- a click on the Zoom To Selected Features
Although these tools are not directly accessible from the application interface, most are easily customizable from ArcObjects within an object oriented development environment, like Visual Basic or C++. Best of all (for those still adapting to COM and ArcObjects), VBA (Visual Basic for Applications) is embedded in the ArcGIS suite of technologies. VBA is the best way to start understanding ArcObjects and to code those “missing tools” from Arcview 3. Basically, ArcObjects is a collection of COM objects, i.e. a collection of components that can be called from a script to customise or extend ArcGIS. Some of these objects can be created as new objects, for example you can design and create a new simple marker symbol, but others can only be created from other objects, eg. you can only create a feature from a featureclass object.
Very broadly, there are two levels of customisation in the ArcGIS environment. You can modify the User Interface with little or no coding; or you can use ArcObjects for more complex coding. To modify the User Interface, select the Customise option from the Tools Menu in ArcMap. From this form you can create new toolbars or modify the existing toolbars and menus by adding and removing commands.
I find a customised toolbar containing selection commands useful and often recommend this to new ArcGIS users. To create a new toolbar, click on the Tools tab in the Customise form and select the “New…” button. In the box that appears, enter the name of the new toolbar (eg My Selection Tools) and click ok. An empty toolbar appears on screen and the new toolbar appears in the list of Toolbars in the Customise form. To add commands to the toolbar, click on the Commands Tab in the Customise form. There are two list boxes displayed, on the left a Category list of commands, and on the right the commands within that category. Scroll down the Category listing and select the Selection Category. You will see the Commands list box now has a list of selection commands. Highlight a command that you use often, eg the Clear Selected Features and drag onto the toolbar you have created. It is worthwhile noting that there are also a number of tools in the Customise Form that are not available in the User Interface, eg Select Features on Screen. An example of a toolbar appears below:
Creating new commands, applications or extensions in ArcGIS requires customisation with ArcObjects. Spatial Vision has a number of years experience in developing applications using ArcObjects and have many generic tools that can be used in the new ArcGIS suite of applications.
A tool whose absence is often lamented upon is the ability to draw a polygon on screen and get its details, eg its area. Attached to this document is a DLL that you can register on your PC. This tool was written in Visual Basic. To use this tool:
- Unzip SVTools.zip
- In ArcMap open the Customise form from the Tools menu.
- Click on the Commands Tab in the Customise form.
- Click on the “Add from File…” button to add the command to the form.
- Navigate to the folder where you have unzipped the DLL and select it. Click on the Open button.
- This will bring up a form which lists the objects being added. Click OK.
- A new category is created called Spatial Vision and under that category is a command called Polygon Area and Centroid.
- Highlight the command and drag to a toolbar in the interface.
- Close the Customise form.
- Click on the tool and draw a polygon. Its area and centroid values are displayed in a form. You can cut and paste these values into any Windows application, if desired.
- The polygon is not created permanently and will be cleared when the screen is refreshed. The area is displayed in the Coordinate System’s Projection System units.
Download the SVTools (60kb)