When using arcpy outside of arcGIS, I have a problem with it displaying layers.
My map consists of group layer which is 'switched off' by default and in this group layer are a few individual layers, which are 'switched on' by default.
There are also some other layers which are always switched on.
Depending upon some options, my code will set the 'visible' property of the group layer to True before exporting to a tiff file.
E.G:
import arcpy
import settings
mxd = arcpy.mapping.MapDocument(settings.mapTemplate)
for layer in arcpy.mapping.ListLayers(mxd):
if (layer.isGroupLayer) and (layer.name == requested):
layer.visible = True
print(layer.visible)
arcpy.mapping.ExportToTiff(mxd, ("C:/test")
Most of the time this code seems to work. The layer.visible always evaluates to True when I expect it to, but ocassionally, the resulting tiff will not show the group layer that was switched on?
I've seen references to similar problems with the visible command throughout geonet, but no specific answers.
Is this an issue that has been recognised by ESRI?
Anyone have any experience with this?