Difference between revisions of "Get Coordinates I"

From PyMOLWiki
Jump to navigation Jump to search
(alternatives)
Line 13: Line 13:
 
cmd.update("pept","tmp")
 
cmd.update("pept","tmp")
 
cmd.delete("tmp")
 
cmd.delete("tmp")
 +
</source>
 +
 +
The same result can be achieved also like this:
 +
 +
<source lang="python">
 +
alter_state 1, pept, (x,y,z) = (-y,x,z)
 +
</source>
 +
 +
or like this:
 +
 +
<source lang="python">
 +
rotate z, 90, pept, camera=0, origin=[0,0,0]
 
</source>
 
</source>
  
 
[[Category:Script_Library|Get Coordinates I]]
 
[[Category:Script_Library|Get Coordinates I]]
 
[[Category:ObjSel_Scripts]]
 
[[Category:ObjSel_Scripts]]

Revision as of 12:28, 10 April 2011

# 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")

The same result can be achieved also like this:

alter_state 1, pept, (x,y,z) = (-y,x,z)

or like this:

rotate z, 90, pept, camera=0, origin=[0,0,0]