Please take a look at: Configurator Commands - #10 by jan
Plese take a look at these parts of the viewer API: