Select to view content in your preferred language

How to Programatically Turn On/Off specific Fields for all layers in an MXD?

2671
2
Jump to solution
08-08-2013 06:43 AM
JesseHopkins
Regular Contributor
Hello there,

I'm wondering, with using Python, if there is a way to turn on/off specific fields (make visible/invisible) for all layers in an MXD, where the data type is an SDE feature class(in my case, each layer's data type is a "Query Feature Class" see image). I am aware of the arcpy class "Fields", but I'm not seeing a way to solve my problem with this.  Any help is greatly appreciated!
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
T__WayneWhitley
Honored Contributor
fieldinfo has a setVisible method, see this:

FieldInfo (arcpy)
Desktop » Geoprocessing » ArcPy » ArcPy classes
http://resources.arcgis.com/en/help/main/10.1/index.html#//018z0000004v000000

At the bottom of the page is a sample to help you set that up in similar fashion...presumably you could set up a list of fields you want to 'turn off' and loop through that while looping through the relevant layers in your map.


Enjoy,
Wayne

View solution in original post

0 Kudos
2 Replies
T__WayneWhitley
Honored Contributor
fieldinfo has a setVisible method, see this:

FieldInfo (arcpy)
Desktop » Geoprocessing » ArcPy » ArcPy classes
http://resources.arcgis.com/en/help/main/10.1/index.html#//018z0000004v000000

At the bottom of the page is a sample to help you set that up in similar fashion...presumably you could set up a list of fields you want to 'turn off' and loop through that while looping through the relevant layers in your map.


Enjoy,
Wayne
0 Kudos
JesseHopkins
Regular Contributor
Ah yes, right there in front of me.  Thanks for the quick response!
0 Kudos