Skip to main content
Formatting etc
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

Arcpy: accessing Accessing "valueField" property of layer's symbology using ArcPy?

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://resources.arcgis.com/en/help/main/10.2/index.html#//00s30000005s000000).

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

valField = lyr.symbology.valueField

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()

valField = lyr.symbology.valueField()

to knowno 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

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://resources.arcgis.com/en/help/main/10.2/index.html#//00s30000005s000000).

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

Accessing "valueField" property of layer's symbology using ArcPy?

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://resources.arcgis.com/en/help/main/10.2/index.html#//00s30000005s000000).

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 no 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

Source Link
Marco_B
  • 2.6k
  • 13
  • 12

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://resources.arcgis.com/en/help/main/10.2/index.html#//00s30000005s000000).

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