mercredi 25 février 2015

Arcpy: accessing "valueField" property of layer's symbology


This has been really hard to debug, as I had no idea where to look at first, but I have made an attempt to access the "valueField" property of a layer file.


This layer file is of the UNIQUE_VALUES symbology type (although I knew it, also successfully tested with code), and thus must have a read/write valueField property associated with it according to the Help (http://ift.tt/1alda45).


However, as soon as I try to access it like:


valField = lyr.symbology.valueField


the script stops dead in its track. Not knowing exactly how to access it (there is only a write example in the Help), I also tried:


valField = lyr.symbology.valueField()


to know avail.


I then noticed in PyScripter, after further configuration of Pyscripter to allow auto-completion with arcpy, that there is no valueField property / method shown... See the first screenshot (no, it's not down the scrollable list). The second screenshot shows I have configured PyScripter properly, as you can see the arcpy auto-completion at work.


What am I missing? I am able to successfully access other properties like labelClasses.


ArcGIS 10.2.0 by the way...


lyr.symbology.valueField


lyr.symbology





Aucun commentaire:

Enregistrer un commentaire