Skip to content

Instantly share code, notes, and snippets.

@wboykinm
Created April 24, 2012 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wboykinm/2481975 to your computer and use it in GitHub Desktop.
Save wboykinm/2481975 to your computer and use it in GitHub Desktop.
Export ArcGIS Symbology
from vb2py.vbfunctions import *
def UVRtoRGB():
pRGB = RgbColor()
pMxDoc = ThisDocument
pGeoFtrLyr = pMxDoc.FocusMap.Layer(0)
pUVRend = pGeoFtrLyr.Renderer
VBFiles.openFile(1, OUTPUT_FILE, 'w')
VBFiles.writeText(1, 'Value,Red,Green,Blue', '\n')
for f in vbForRange(0, pUVRend.ValueCount - 1):
sVal = pUVRend.Value(f)
pFillSym = pUVRend.Symbol(sVal)
pRGB.RGB = pFillSym.Color.RGB
VBFiles.writeText(1, sVal, ',', CStr(pRGB.Red), ',', CStr(pRGB.Green), ',', CStr(pRGB.Blue), '\n')
VBFiles.closeFile(1)
MsgBox('RGBs Exported', vbInformation)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment