English

How To: Use colors from an ArcInfo shadeset in ArcView

Summary

ArcInfo shadesets contain fill patterns and colors. ArcView uses the pattern information when the shadeset is loaded into a fill palette, however, the color information is not used. If a colormap is created from the shadeset in ArcInfo, it is possible to use an Avenue script to convert the colors in the colormap to an ArcView color palette.

Procedure

  1. Create a colormap from the ArcInfo shadeset.
    See: How To: Create a colormap from a shadeset using ArcInfo GRID
  2. Start ArcView and open a new script window.
    A. Activate the Project window.
    B. Click the Scripts icon.
    C. Click New.
  3. Paste the following code into the new script window.
    Code:
    f = FileDialog.Show ("*", "All Files", "Select ColorMap")
    
    If (f = nil) Then 
      Return nil
    End
    
    lf = linefile.Make(f.Getname.asFileName, #FILE_PERM_READ)
    lf.GoToEnd
    TheEnd = lf.Getpos
    lf.setpos(2)
    
    cList = {}
    
    for each l in 2 .. TheEnd
    
      valList = lf.ReadElt
      If ((valList = nil) or (valList = "")) Then
        Break
      End
      c = Color.Make
      r = valList.asList.Get(1).asNumber
      g = valList.asList.Get(2).asNumber
      b = valList.asList.Get(3).asNumber
      c.setRGBlist({r,g,b}) 
      cList.add(c)
    
    End
    
    aPalette = Palette.Make
    aPalette.SetList (#PALETTE_LIST_COLOR, SymbolList.FromList(cList))
    
    fnew = FileDialog.Put ("colormap.avp".asFileName, "avp", 
    "Save Color Palette")
    
    If (fnew = nil) Then 
      Return nil
    End
    
    aPalette.SaveToFile (#PALETTE_LIST_COLOR, fnew) 
  4. Select Compile from the Script menu and click the Run button.
  5. Select the colormap file.
  6. Specify a new color palette file.
  7. Select 'Show Symbol Window' from the Window Menu.
  8. Click the Palette Manager button (the far right button).
  9. Click the Load button.
  10. Select the color palette created in step 5 and click OK.