Difference between revisions of "Get Coordinates I"

From PyMOLWiki
Jump to navigation Jump to search
Line 15: Line 15:
 
</source>
 
</source>
  
[[Category:Scripting_Script_Library|Get Coordinates I]]
+
[[Category:Script_Library|Get Coordinates I]]

Revision as of 17:27, 6 May 2005

# This script gets a copy of the coordinates in Python,
# rotates the object about the Z axis, and then
# updates the coordinates in the original object.

from pymol import cmd

model = cmd.get_model("pept")
for a in model.atom:
   a.coord=[ -a.coord[1], a.coord[0], a.coord[2]]

cmd.load_model(model,"tmp")
cmd.update("pept","tmp")
cmd.delete("tmp")