PROBLEM
The Rematch Addresses option under the Theme menu is grayed out for geocoded themes that are added to new projects.
If you add the results of a geocode to a new project, ArcView doesn't know the theme was generated by the geocoding process.
Code:
'--- ThemeRematch.ave
'-- This script prompts user to pick a view with themes in it,
'-- it then prompts the user to pick the themes, and then writes
'-- out the themes to odb files.
'-- Get docs in project
aDocList = av.GetProject.GetDocs.Clone
'-- Pick doc you want
aView = MsgBox.ChoiceAsString(aDocList,"Pick your view","Viewpicker")
'-- Get themes from the view
aThemeList = av.GetProject.FindDoc(aView.AsString).GetThemes
'-- Have user pick reference theme
aRefTheme = MsgBox.Choice(aThemeList,"Pick your reference theme","Reference Theme picker")
'-- Pick geocoded theme
aGeoTheme = MsgBox.Choice(aThemeList,"Pick your geocoded theme","Geocoding theme picker")
'-- Create odb - will write to the $HOME directory
anOdb = ODB.Make("GeoOdbTest.odb".AsFileName)
'-- Add themes to it
anODB.add(aRefTheme)
anODB.add(aGeoTheme)
anODB.Commit
'-- Ask if user wants to add it into the present project
aBool=MsgBox.YesNo("Do you want to add these into a new view?","Add themes?",true)
if (aBool) then
av.run("script2",anODB)
end
Code:
'-- Bring odb back into project
ODB2 = ODB.Open("GeoOdbTest.odb".AsFileName)
F1 = ODB2.Get(0)
F2 = ODB2.Get(1)
'-- Make view object
aView = View.Make
'-- Place into view document
aView.AddTheme(F1)
aView.AddTheme(F2)
'-- Open the view
aView.GetWin.Open
Note:
To load the ODB into a new project, open the new project, create a new script, paste in the second script, and run it.
Article ID:000003649
Get help from ArcGIS experts
Download the Esri Support App