ArcPy SHAPE, SHAPE_Area, SHAPE_Length fields are always VISIBLE, why?

721
0
10-16-2018 08:21 PM
GISAdmin35
New Contributor II

Hi All,

I am trying to write unit tests that will ensure all SHAPE related fields within an MXD are hidden. However, even if the SHAPE field visibility is unchecked within the ArcMAP -> Layer Properties -> Fields -> "Choose which fields will be visible" GUI, it seems impossible to read/access this state in ArcPY.

The following will all return "VISIBLE" rather than "HIDDEN" even if they have been hidden (as above):

arcpy.Describe(lyr).fieldInfo.getVisible(arcpy.Describe(lyr).fieldInfo.findFieldByName("SHAPE"))

arcpy.Describe(lyr).fieldInfo.getVisible(arcpy.Describe(lyr).fieldInfo.findFieldByName("SHAPE_Area"))

arcpy.Describe(lyr).fieldInfo.getVisible(arcpy.Describe(lyr).fieldInfo.findFieldByName("SHAPE_Length"))

In addition, Non-SHAPE related fields all return a result that always correlates to what is seen in the GUI. 

arcpy.Describe(lyr).fieldInfo.getVisible(arcpy.Describe(lyr).fieldInfo.findFieldByName("MY_HIDDEN_FIELD")) will return "HIDDEN".

I could jump to some conclusion blindly about why this is logical, however it would be far better to have any such explanation added to the documentation currently @ FieldInfo—ArcPy classes | ArcGIS Desktop 

Any help/explanation/workaround would be greatly appreciated.

Thanks in advance.

0 Kudos
0 Replies