Oh, but that won't lock all vports in all layouts, nor will it let you select any, nor will it change the color of the viewports to give a visual queue to the user of the current state of the vport, nor will it ensure that all viewports are on the same layer, nor wil it ensure that they are on, thawed, unlocked and non-plottable. Have a look at the code bman.