this question was asked 4 years ago, but still no solution.
Solved: UNDO "Make this the only selectable layer" - Esri Community
apparently, it should be simple and straightforward, but practically it is a pain.
I have 4 CAD layers in a map, and I made one of them as only selectable, the problem is the CAD files are groups within groups. now when I want to make all layer selectable I have to go to all groups expand them and make all of the selectable.
this procedure is fine for on time, but for several time it is simply a pain. I looked at arcpy to find away iterate over layer to make all of them selectable but could not find a solution.
The requested feature us add a command to make all layers (supported layers) selectable.
It is possible to do this using CIM access, but it takes a bit of time, so I would appreciate it if there were a better way to do it.
import arcpy
aprx=arcpy.mp.ArcGISProject("CURRENT")
view=aprx.activeView
mapname=view.map.name
maps=aprx.listMaps(mapname)[0]
lyrs=maps.listLayers()
for l in lyrs:
l_cim=l.getDefinition('V3')
try:
if l_cim.selectable:
continue
else:
l_cim.selectable=True
l.setDefinition(l_cim)
except:
continue
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.