In Pro, I can enable/disable editing/selection of specific layers via the List by Editing tab and the List by Selection tab.
I would like to be able to be able to do the same using arcpy.
Example use case:
I have a map with specific layers that I want to protect the source data from being inadvertently modified during an edit session.
I would run a script tool to disable editing and or selection for specific layers in my map.
This is something that can be done using Python CIM Access.
p = arcpy.mp.ArcGISProject('current')
m = p.listMaps()[0]
l = m.listLayers('Cities')[0]
l_cim = l.getDefinition('V3') #Get the layer's CIM definition
l_cim.featureTable.editable = False #Modify the editable state
l.setDefinition(l_cim) #Push the CIM changes back to the layer
Awesome, thanks for the example.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.