This is a read-only mirror of pymolwiki.org

Difference between revisions of "Get Coordinates II"

From PyMOL Wiki
Jump to navigation Jump to search
 
m (3 revisions)
 
(2 intermediate revisions by the same user not shown)
Line 16: Line 16:
 
</source>
 
</source>
  
[[Category:Scripting_Script_Library|Get Coordinates II]]
+
[[Category:Script_Library|Get Coordinates II]]
 +
[[Category:ObjSel_Scripts]]

Latest revision as of 01:46, 28 March 2014

from pymol import cmd
from pymol import stored

stored.xyz = []
cmd.iterate_state(1,"pept","stored.xyz.append([x,y,z])")

# at this point, stored.xyz is a native Python array holding
# the coordinates, which you can modify as required

stored.xyz = map(lambda v:[-v[1],v[0],v[2]],stored.xyz)

# and now you can update the internal coordinate sets

cmd.alter_state(1,"pept","(x,y,z)=stored.xyz.pop(0)")