I had a similar "this can't be selectable" routine. I built a scriptJob that was triggered by a selection change. It ran a script that would filter through the selected items ($selObj = ls -sl
; for ($obj in $selObj) ) and compared it to an array of "do not touch" objects. But running a loop on everything selected against an array of all the unselectable items tends to be slow.
Another thing I tried was assigning all the unselectable items to a layer, and checking the selected items to see if any of them was in the layer. But then you may have to pickWalk up some to see if a parent object is in the untouchable list.
This doesn't make it "unselectable", it just deselects it. The user will still see the item selected, and then imediately unselected. (Some help UI might ease the learning curve.)
(trigger the visibility of the linkages through the same script . . . )
And then you'll open your scene some day, and want to change an untouchable object. Just kill the script job. (Yeah, it sounds simple, but I spent a few minutes trying to click on them before I realized what was going on.)