Create a Measured Grid


Using this sample, you can programmatically create a measured grid. The measured grid can have your choice of a formatted grid label or a mixed font grid label. It can have a simple or a calibrated map grid border.

How to use:
  1. In ArcMap, go to File menu > New. In the dialog that comes up, chose USA > CoterminousUSA.mxt and hit OK. You will have created a new document with this template.
  2. Import this sample's .BAS file. To do this, open the Visual Basic Editor and in the Project Explorer, right-click on Project > Import File. In the dialog that comes up, select this sample's .BAS file.
  3. Open the .BAS file and run the CreateMeasuredGrid procedure. This will draw a measured grid with a formatted grid label and a simple border.
  4. Alternatively, you can draw the graticule with a mixed font grid label or a calibrated border. You can switch the grid label type and map grid border type in the CreateMeasuredGrid procedure. The procedure has comments that will guide you in doing this.


Requires: A map document created with the CoterminousUSA.mxt template.

Difficulty: Beginner

Visual Basic
File Description
basCreateMeasuredGrid.bas Procedures for creating a measured grid.

Key CoClasses: MeasuredGrid, FormattedGridLabel, MixedFontGridLabel, SimpleMapGridBorder, CalibratedMapGridBorder
Key Interfaces: IMapGrid, IMeasuredGrid, IProjectedGrid, IGraphicsContainer, IMapFrame, IActiveView, IMapGrids, IFormattedGridLabel, IMixedFontGridLabel, IGridLabel, IFontDisp, ISimpleMapGridBorder, ICalibratedMapGridBorder, IStyleGallery, IEnumStyleGalleryItem, IStyleGalleryItem