A macro or script to lock all details

Hey Mitch,

A few weeks ago (February 11th) you gave me a python script to lock all details and unlock all details. I wonder if I could get a script that would do the same but instead of locking them from being able to move the camera inside them, locking them so that they cannot be activated? The “lock” for this is the same lock one uses to lock down an object from moving. The reason for this is that sometimes when you’re in layout space working over a detail, you can accidentally activate it when you don’t want to. You then have to zoom out and double-click outside the detail to de-activate it.

Thank you.

Cosmas

@Helvetosaur