PROBLEM

Composite markers generated with Avenue are in the wrong color on the view

Last Published: April 25, 2020

Description

After running the 'Create composite marker' script, the new marker appears as expected in Symbol Window, but the marker is in the wrong color when added to the view. Also, the foreground and back ground colors can not be changed independently.

Cause

The script used to generate the marker does not lock the marker element colors.

Solution or Workaround

The following script demonstrates how to create a composite marker with the color locked for each element.

  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 new window:

    Code:
    '-- Sample Script

    av.GetSymbolWin.Open
    av.GetSymbolWin.SetPanel(#SYMBOLWIN_PANEL_MARKER)

    '-- Set the properties of each marker symbol according
    '-- to your requirements.

    m1 = BasicMarker.Make
    m1.SetStyle(#BASICMARKER_STYLE_PATTERN)
    m1.SetSize(16)
    m1.SetColor(Color.GetRed)

    '-- Lock the first color
    m1.SetColorLock(true)
    m1.SetFont(Font.Make("ESRI Cartography","normal"))
    m1.SetCharacter(5)

    m2 = BasicMarker.Make
    m2.SetStyle(#BASICMARKER_STYLE_PATTERN)
    m2.SetSize(16)
    m2.SetColor(Color.GetBlue)

    '-- Uncomment the next line to lock the second color
    'm2.SetColorLock(true)
    m2.SetFont(Font.Make("ESRI Cartography","normal"))

    m2.SetCharacter(35)

    '-- Make as marker symbols as there are layers in your composite symbol

    cm = CompositeMarker.Make(SymbolList.FromList({m1,m2}))

    mp = av.GetSymbolWin.GetPalette.GetList(#PALETTE_LIST_MARKER)
    mp.Add(cm)

    av.GetSymbolWin.RefreshPalette(#PALETTE_LIST_MARKER)

  3. Click the
    [O-Image] Script compile button
    button to compile the script.
  4. Click the
    [O-Image] Run compiled script button
    button to run the script.

Article ID:000004222

Software:
  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic