Get viewport from view

I am creating views and placing them on sheets. I want to alter the viewtype in the same script, not a new script.

These are views, not view templates.

This is following on from this thread: