As a result of a wish by Dan Bayn about providing WorkNC-like temporary zooming I wrote the following plugin:
ToggleZoom.zip (3.2 KB)
It doesn’t actually do what was asked for, but the way to use it is to install the plugin and put the command ToggleZoom into the middle mouse button macro:
Middle click anywhere in the viewport and the camera zooms in, click again anywhere within the same viewport and the camera zooms out again. Zooming happens by adjusting the lens-length in perspective viewports and by changing the camera position in parallel viewports. The ToggleZoom command can of course also be run through the command line, but it will only work if the cursor is over the currently active viewport.
The zoom factor to use can be adjusted using the ToggleZoomFactor command.