How To: Set the brightness theme of a grid using Avenue


The brightness theme of a grid can be specified through Avenue using the GLegExt class on the GTheme legend.


The following sample code can be used to set the brightness theme. This sample code uses datasets from the \esri\av_gis30\arctutor\spatial directory.

  1. Copy and paste the sample code below into a new script editor window.

    'The following script shows how to set the brightness
    'To test, load the Spatial Analyst Extension
    'Add the Hillshd and Elevgrd themes to a View
    'Make Elevgrd the first theme in the TOC.
    theView = av.GetActiveDoc
    thetheme = theView.Getthemes.Get(0) 'Elevgrd
    theLegend = thetheme.GetLegend

    theGLegExtension = theLegend.GetExtension(GLegExt)
    theGLegExtension.SetbrightnessRange(4, 89)


  2. Press the Compile button.
    [O-Image] Script compile button
  3. Tile the ArcView window so you can see the View and Script windows at the same time.
  4. Click from the View directly to the Script window.
  5. From the script window, click the Run button.
    [O-Image] Run compiled script button