You are on page 1of 17

Customizing ArcGIS

Spring 2008

GISC 6382 Applied GIS UT-

Customization in ARCGIS
Two levels of Customization
Customizing the Interface
To create more efficient user interfaces
For yourself (e.g. grouping frequently used tools)
For specialized applications (e.g. simplified interface for data entry operators)

To access capabilities not on the standard interface

Supplied as part of ArcGIS but not on the standard interface (many!)
Downloaded from the web
From ESRI web site, supplied by ESRI or users
From other web sites

Developed by you

Developing Additional Capabilities

Automating repetitive tasks
Creating new analytical procedures

Our focus here will be on customizing the interface. GIS 5317

Programming for GIS will focus on developing additional capabilities.
GISC 6382 Applied GIS UT-

Options for Developing Additional Capabilities

Current GenerationESRI ARCGIS


Multi-step, sequential processing of ArcTools, using a visual development

environment which comes as part of ArcGIS

Python, Jscript and VBScript

standardized and relatively simple scripting languages for repetitive
processing, including loops and decision trees, using ArcTools
Python scripts can be generated from Modelbuilder

Visual Basic for Applications

Permits writing of VB macros for sophisticated customization and
development within standard ArcGIS (ArcMap/ArcCatalog) interface (and
thus requires license for these)
may incorporate ArcObjects, the COM compliant software objects out of
which ArcGIS is constructed.

ArcGIS Engine
Set of embeddable GIS components (ArcObjects software objects) for use
in building custom applications, independent of ArcGIS interface
Runs under Windows, Unix and Linux, with support for Java, C++, COM
and .NET

GISC 6382 Applied GIS UT-

Options for Developing Additional Capabilities

Earlier Generations: ESRI


Microsoft COM compliant objects used to incorporate geographic

capability in standard IT applications, introduced around 1997
Replaced by ArcEngine/ArcObjects

The proprietary object oriented programming language used for ESRIs
first GUI based product, ArcVIEW, introduced in 1993,
Not compatible with ArcGIS 8 or 9
Most Avenue-based applications have now been replaced with ArcGIS 8/9

AMLs: Arc Macro Language

The scripting language associated with ESRIs original ArcInfo product
introduced in 1981
Can still be run within ArcGIS 9 via:
ArcInfo Workstation interface
Via a tool on a toolbar in Arc Map or ArcCatalog

GISC 6382 Applied GIS UT-

Options for Developing Additional Capabilities

Current Generationnon-ESRI
Other major GIS software vendors have equivalents to
ArcEngine e.g. MapInfo MapX
TatukGIS specializes in providing GIS software
component objects (and there are others)

Google Map and Google Earth mashups, combining

your own data and applications with Google Map or
Google Earth using kml scripts (keyhole markup
GISC 6382 Applied GIS UT-

Customization Dialog Box

A graphic interface for
customization. To open
Go to Tools>Customization
Or, double click on empty
area in a toolbar

Modify user interface

Turn toolbars on and off

Create new toolbars
Create new controls
Add, delete, and move
controls (buttons and menus)
Manage shortcut keys

GISC 6382 Applied GIS UT-

Creating a new tool bar

Organize related controls

Name the toolbar
Drag commands, controls, or
macros onto (off) the toolbar

GISC 6382 Applied GIS UT-

Creating a Menu

New Menu and Menu Items

GISC 6382 Applied GIS UT-

Adding commands to context menus

Add the context Menu toolbar

Drag commands onto the context menu

GISC 6382 Applied GIS UT-

Shortcut Keys

Keyboard button in the customize dialog

Change the shortcut key for any command

GISC 6382 Applied GIS UT-


UI Controls
User Interface (UI)
UIButtons, UItools,
UIEditBoxs, and

Control Properties

Text or no text

GISC 6382 Applied GIS UT-


Visual Basic Editor

Tools> Macros> Visual Basic Editor
View Source

GISC 6382 Applied GIS UT-


Help for your controls
Set the Tooltip property
Help message in the status bar (Message)

GISC 6382 Applied GIS UT-


Save Customizations

ArcMap has three level of storage

Normal Template (Normal.mxt):
Affect all documents
Template (MyTemp.mxt): Affects
all documents using this template
This Document (Myproject.mxd):
Affects this document only

ArcCatalog only uses a normal


GISC 6382 Applied GIS UT-


Code for Fixed Zoom-In
What about Fixed Zoom-out
Dim pDoc As IMxDocument
Dim pEnv As IEnvelope
Set pDoc = ThisDocument
Set pEnv = pDoc.ActiveView.Extent
pEnv.Expand 0.5, 0.5, True
pDoc.ActivatedView.Extent = pEnv

GISC 6382 Applied GIS UT-


AMLs: Arc Macro Language

The scripting language associated with ESRIs original ArcInfo
Essentially allows ArcInfo commands to be saved in a text file and
then executed in batch
Based on the operating system for the Prime minicomputer of the
Conceptually similar to the old DOS .bat files
Was the only way to be productive in ArcInfo version 7 and
Many AMLs still exist and need to be converted
Still runs in Workstation ArcInfo
ArcCatalog will generate and save AML scripts
With the introduction of scripting capabilities in ArcGIS 9.0,
AMLs no longer useful
Most AML capabilities can be re-created with python script.

GISC 6382 Applied GIS UT-


Running an AML in ArcGis Workstation

Initiate an ArcGIS Workstation session

If necessary, use the CREATWWORKSPACE command to create a workspace

Use the command WORKSPACE to move into the new workspace

&TERM 9999

(directs AML output to your terminal)

(directs any graphic output to terminalnot needed here)
(sends debug info to terminalturn off with &OFF)

&RUN utd_newtin.aml

After AML finishes, check that AML tasks completed successfully, e.g. use the DIRECTORY TIN
command to list TINs created

Use Explorer to copy p:\data\p6382\exercises\custom\utd_newtin.aml

Use Wordpad to specify appropriate directory for CREATETIN command

Run the AML with the &RUN command


Establish the necessary environment for running an AML

Use a standard text processor (e.g. Wordpad) to create/edit your AML and be sure it is saved as a text
file with the extension of .aml (place double quotes around name in save box e.g. newaml.aml)

cw c:\usr\ini\custom


For practice, run the AML: giscity.aml

Issue the command END in the Arc window to close the graphic window.

GISC 6382 Applied GIS UT-