How to change sketch vertex symbolization


The following code alters the default color and symbolization of the edit sketch vertices. Sketch vertices are made larger and blue, the selected vertex remains red but is also made larger.

How to use

  1. Load a polyline or polygon feature layer into ArcMap and Start Editing.
  2. Paste the code into VBA and run the subroutine.
  3. Start a new sketch using the Editor's sketch tools.
[VBA]
Public Sub ChangeSketchVertexSymbolColors()
    Dim pEditor As IEditor
    Dim pID As New UID
    Dim pEditProps As IEditProperties
    Dim pVertexSym As ISimpleMarkerSymbol
    Dim pVertexColor As IRgbColor
    Dim pSelectedColor As IRgbColor
    Dim pSelectedVertexSym As ISimpleMarkerSymbol
    
    'Get a handle to the Editor
    pID = "esriEditor.Editor"
    Set pEditor = Application.FindExtensionByCLSID(pID)
    Set pEditProps = pEditor
    
    'Create a new Color object
    Set pVertexColor = New RgbColor
    pVertexColor.Blue = 150
    
    'create a new MarkerSymbol and apply it to the Edit Sketch Properties
    Set pVertexSym = New SimpleMarkerSymbol
    With pVertexSym
        .Color = pVertexColor
        .Style = esriSMSDiamond
        .Size = 8
    End With
    
    Set pEditProps.SketchVertexSymbol = pVertexSym
    
    'now change the selected vertex symbol
    Set pSelectedVertexSym = New SimpleMarkerSymbol
    Set pSelectedColor = New RgbColor
    pSelectedColor.Red = 255
    
    With pSelectedVertexSym
        .Color = pSelectedColor
        .Size = 8
        .Style = esriSMSDiamond
    End With
    
    'apply the new symbol to the Edit Sketch Properties
    Set pEditProps.SelectedVertexSymbol = pSelectedVertexSym
    
End Sub






Additional Requirements
  • An Edit Session.