English

How To: Add newly-converted shapefiles to a different view

Summary

When creating a shapefile from an active theme, ArcView gives you the option to add the shapefile to the current view; however, it doesn't give you the option to add a newly-converted shapefile to a different view. This document explains how to customize ArcView to have that option.

Procedure

  1. Create a new script window and load the View.Export system script.
  2. Paste the following code beneath the View.Export code and compile script.

    Code:
    '-- make a list of views
    dl = {}
    for each d in av.GetProject.GetDocs
    if (d.Is(View)) then
    dl.Add(d)
    end
    end

    '-- provide a choice for a new view
    dl.Add("<New View>")

    AddToView = MsgBox.ListAsString(dl,"Add Theme to:", "Convert to Shapefile")

    if (AddToView <> nil) then
    if (AddToView = "<New View>") then
    AddToView = View.Make
    AddToView.GetWin.Open
    end

    '-- create a theme and add it to the specifiedView
    fthm = FTheme.Make(anFTab)
    AddToView.AddTheme(fthm)
    'bring the View to the front
    AddToView.GetWin.Activate
    end

  3. Rename the script to View.Export.

    A. Select Properties from the Script menu.
    B. Type in a new name in the Name field.
    C. Click OK.

  4. Make a theme active and select Convert to Shapefile from the Theme menu.
  5. Specify the name and location for new shapefile and click OK.
  6. Click Yes when asked if you would like to add the new shapefile to a view.
  7. Select a view where the new shapefile should be added.

    Warning:
    The shapefile will be added to the specified view as well as to the current view. In order to add the shapefile to only the specified view, delete the following lines from the source code


    Code:
    '-- create a theme and add it to the View
    fthm = FTheme.Make(anFTab)
    theView.AddTheme(fthm)