Get Model

From PyMOLWiki
Revision as of 13:39, 26 September 2007 by Momeara (talk | contribs) (NOTES)
Jump to: navigation, search

DESCRIPTION

get_model returns a model object.

PYMOL API

cmd.get_model(string "selection" )

USAGE

cmd.get_model("chain A")

NOTES

It can be useful to loop through all the atoms of a selection (rather than using the iterate command)

atoms = cmd.get_model("chain A")
for at in atoms.atom:
    print "ATOM DEFINITION: "+at.chain+" "+at.resn+" "+str(at.resi)+" "+at.name+" "+str(at.index)+" "+at.b+" "+str(at.coords[0])+" "+str(at.coords[1])+" "+str(at.coords[2])

SEE ALSO