HOW TO
The edit sketch is used in ArcMap when sketching new features or editing existing ones. By default, the edit sketch is a green line with green vertices. The appearance of the sketch may need to be changed to make it easier to see, such as when tracing features over a dark raster image. This article provides Visual Basic for Applications (VBA) code to change the symbols used in the edit sketch.
Note:
To store the code in all the map documents, open the Normal.mxt ThisDocument code module instead.
Code:
Private Sub ChangeSketchSymbol()
'Get a reference to the Editor extension
Dim pEditor As IEditor
Dim pID As New UID
pID = "esriEditor.Editor"
Set pEditor = Application.FindExtensionByCLSID(pID)
Dim pEditProperties As IEditProperties
Set pEditProperties = pEditor
'Declare and set up the sketch line symbol
Dim pLineSym As ILineSymbol
Dim pLineColor As IRgbColor
Set pLineSym = pEditProperties.SketchSymbol
'Set up the sketch line color. The default is Red=0, Green=128, Blue=0.
Set pLineColor = New RgbColor
pLineColor.RGB = RGB(0, 128, 0) 'Enter new RGB values to change the sketch line color
'Set up the sketch line symbol properties
Set pLineSym = New SimpleLineSymbol
With pLineSym
.Color = pLineColor
.Width = 1 'Enter a new value to change the sketch line width
End With
Set pEditProperties.SketchSymbol = pLineSym
'Declare and set up the sketch vertex symbol
Dim pVertexSym As ISimpleMarkerSymbol
Dim pVertexColor As IRgbColor
'Set up the sketch vertex color. The default is Red=0, Green=128, Blue=0.
Set pVertexColor = New RgbColor
pVertexColor.RGB = RGB(0, 128, 0) 'Enter new RGB values to change the sketch vertex color
'Set up the sketch vertex symbol properties
Set pVertexSym = New SimpleMarkerSymbol
With pVertexSym
.Color = pVertexColor
.Style = esriSMSSquare 'Enter a new style to change the sketch vertex shape.
.size = 4 'Enter a new value to change the sketch vertex size
End With
Set pEditProperties.SketchVertexSymbol = pVertexSym
End Sub
Article ID:000009427
Get help from ArcGIS experts
Download the Esri Support App