11.07.2015 Views

VMD User's Guide

VMD User's Guide

VMD User's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

}# turn everything offmol off all# turn each molecule on then off againforeach mol [molinfo list] {if $disp($mol) {mol on $molsleep 1mol off $mol}}# turn the original ones back onforeach mol [molinfo list] {if $disp($mol) {mol on $mol }}The last loop, which turns the originally drawn molecules back on, doesn’t turn them on atthe same time. That’s because some commands (those which use the command queue) redraw thegraphics when they are used. This can be disabled with the display update (see section 8.3.6 formore information). Using this, the final loop becomes#turn the original ones back ondisplay update offforeach mol [molinfo list] {if $disp($mol) {mol on $mol }}display update onAlternatively, since the drawn option is settable, you could do:foreach mol [molinfo list] {if $disp($mol) {molinfo $mol set drawn 1}}However, that won’t set the flag to redraw the scene so you need to force a redraw with displayredraw.11.2 Using the atomselect commandAtom selection is the primary method to access information about the atoms in a molecule. Itworks in two steps. The first step is to create a selection given the selection text, molecule id, andoptional frame number. This is done by a function called atomselect, which returns the name ofthe new atom selection. the second step is to use the created selection to access the informationabout the atoms in the selections.Atom selection is implemented as a Tcl function. The data returned from atomselect is thename of the function to use. The name is of the form atomselect%d where ’%d’ is a non-negativenumber (such as ’atomselect0’, atomselect26’, ...).The way to use the function created by the atomselect command is to store the name into avariable, then use the variable to get the name when needed.156

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!