English

How To: Make themes matchable in a view

Summary

The script in this article uses the MatchSource request to create matchable themes from those in a view.

Procedure

If you modify this script, make sure the Address style is included in the loop setup.

  1. Open a new Script window.

    A. Activate the Project window.
    B. Click the Scripts icon.
    C. Click New.

  2. Copy the following code into the script window:

    Code:
    '-- This script will build the geocoding indexes ArcView
    '-- needs to match addresses to the street theme.

    theView=av.GetActiveDoc
    theThemes=theView.GetThemes
    theStyleFN=AddressStyle.GetDefStylesODB

    For each theTheme in theThemes
    theStyle=AddressStyle.FindStyle("US Streets with Zone")
    theFTab=theTheme.GetFTab
    theList={theFTab.FindField("L-f-Add"),
    theFTab.FindField("R-f-Add"),
    theFTab.FindField("L-t-Add"),
    theFTab.FindField("R-t-Add"),
    theFTab.FindField("FdPre"),
    "",
    theFTab.FindField("FNAME"),
    theFTab.FindField("FTYPE"),
    "",
    theFTab.FindField("ZIPL"),
    theFTab.FindField("ZIPR")}

    theSource=MatchSource.Make(theStyle,theTheme,theList)
    theTheme.SetMatchSource(theSource)

    End

    Note:
    Make sure the items in the list of fields to find are the names of the fields in the street theme.

  3. Click the
    [O-Image] Script compile button
    button to compile the script.
  4. Click the view window.
  5. Make the street theme active.
  6. Click the script window.
  7. Click the
    [O-Image] Run compiled script button
    button to run the script.