Change viewport programmatically

There is an answer in this topic

http://forums.creativeclouddeveloper.com/t/is-posible-to-set-a-zoom-event/5268/1