Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
This expands the function of View>Look At Selection function found in the viewport menus.
While the script is running, each time the selection of components is changed, the new components are centered in the current viewport. This can be very useful when modeling as you don't need to fuss with trying to reposition the model in the viewport in order to get a useful view of the components you are modifying. Once they are centered, rotating the view will rotate around the components (perspective cams), zooming will zoom straight in on them.
The script is a toggle, so invoking it will toggle it on and off.
I don't know how far back this is compatible, but probably quite a few versions. Lemme know if you find it useful or have suggestions for improvement.