Thanks... well that kind of worked. It at least only prints out the name of the layers that are visible, but I still get a nasty little error.
Traceback (most recent call last):
File "c:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\arcobjects\_base.py", line 90, in _get
return convertArcObjectToPythonObject(getattr(self._arc_object, attr_name))
AttributeError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "\\san_marcos\files\DeptShares\Public Services\Transportation\GIS\Scripts\Python\OpenRecordsRequestReWrite.py", line 15, in <module>
if layer.visible:
File "c:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\arcobjects\_base.py", line 93, in _get
raise AttributeError(
AttributeError: The attribute 'visible' is not supported on this instance of Layer.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\arcobjects\_base.py", line 90, in _get
return convertArcObjectToPythonObject(getattr(self._arc_object, attr_name))
AttributeError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "\\san_marcos\files\DeptShares\Public Services\Transportation\GIS\Scripts\Python\OpenRecordsRequestReWrite.py", line 18, in <module>
print("error - " + layer.name)
File "c:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\arcobjects\_base.py", line 93, in _get
raise AttributeError(
AttributeError: The attribute 'name' is not supported on this instance of Layer.