11.07.2015 Views

VMD User's Guide

VMD User's Guide

VMD User's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 11Molecular Analysis11.1 Using the molinfo commandThis section covers how to extract information about molecules and atoms using the <strong>VMD</strong> textcommand molinfo.Examples:Two functions, one to save the current view position, the other to restore it. The position ofthe axis is not changed by these operations.proc save_viewpoint {} {global viewpointsif [info exists viewpoints] {unset viewpoints}# get the current matriciesforeach mol [molinfo list] {set viewpoints($mol) [molinfo $mol get {center_matrix rotate_matrix scale_matrix global_matrix}]}}proc restore_viewpoint {} {global viewpointsforeach mol [molinfo list] {puts "Trying $mol"if [info exists viewpoints($mol)] {molinfo $mol set {center_matrix rotate_matrix scale_matrixglobal_matrix} $viewpoints($mol)}}}Cycle through the list of displayed molecules, turning each one on one at a time. At the end,return the display flags to their original state.# save the current display stateforeach mol [molinfo list] {set disp($mol) [molinfo $mol get drawn]155

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

Saved successfully!

Ooh no, something went wrong!