HOW TO
When you assign a symbol to a graphic, it is important you select the appropriate symbol type for the graphic type. If you select the wrong symbol type, you may get error messages.
This script below demonstrates how to check the graphic type before assigning a symbol.
Code:
'-- Get the GraphicList from the active view document
theView = av.GetActiveDoc
theGList = theView.GetGraphics
'-- Create a BasicMarker symbol type
aBasicMarker = BasicMarker.Make
aBasicMarker.SetColor(Color.GetRed)
'-- Create a TextSymbol symbol type
aTextSymbol = TextSymbol.Make
aTextSymbol.SetSize(24)
'-- Cycle through the GraphicList
'-- If it is a GraphicShape of type point, set symbol to aBasicMarker
'-- If it is a GraphicText, set symbol to aTextSymbol
for each g in theGList
If (g.is(GraphicShape)) Then
If (g.GetShape.Is(Point)) Then
g.SetSymbol(aBasicMarker)
End
ElseIf (g.Is(GraphicText)) then
g.SetSymbol(aTextSymbol)
End
End
theView.Invalidate
Note:
For additional properties you can set for each symbol type, see the Symbol(Class) topic in ArcView Help.
Article ID:000002501
Get help from ArcGIS experts
Download the Esri Support App