I succesfully wrote a script to render a Uniquevaluerenderer in a layer in ArcMAP using symbols from 4 parameters (values) read from the attribute table of the layer. I used ArcObjects and VBA, but with VBA support being discontinued in ArcGIS 10 I now want to convert this script using Python. Can anyone suggest some pointers or sample code.

  • If you want to stick with your ArcObjects code, you may find the question How do I access ArcObjects from Python? helpful. – RyanDalton Aug 28 '13 at 14:28
  • You could "cheat" by creating a layer file with all your rendering done and load that resetting the data source? – Hornbydd Nov 14 '13 at 19:43

Since ArcGIS 10.1, you can use UniqueValueSymbology to edit it. Please follow ArcGIS Help 10.1 UniqueValuesSymbology section http://resources.arcgis.com/en/help/main/10.1/index.html#/UniqueValuesSymbology/00s30000005s000000/
However, Arcpy doesn't implement all of ArcObjects functions such as change to UniqueValueRenderer from the other renderers, and change each values symbol. So, If you have source code written in VBA and its works, then better way is migration it to ArcMap Addin. For more information, please follow bellow topic. http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Building_add_ins_for_ArcGIS_Desktop/0001000000w2000000/

  • Darksanta's comments on my initial question are noted and I will follow up on these. – H J Brynard Jul 28 '13 at 20:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.