Hi George,

You might want to use cmd.get_model() to make your life  easier. It turns a selection into a chempy model, which has an attribute .atom, containing all the corresponding atoms with names, identifiers, coordinates, etc.
Check scripts on the pymolwiki that do comparable things.

Hope it helps,


On Oct 15, 2011 12:03 AM, "George Kvaratskhelia" <kvaratskhelia9@gmail.com> wrote:

I'm writing a function script in Python for PyMOL and I need to convert an atoms number to its location, or somehow gain a list of atom locations form a group location.
When the script is ran and the function is used the atom locations are entered : 

If I could somehow turn those two group locations into two lists or atom names in those groups then I could finish writing this program. But I am having no luck of converting the group location or the atom number to the atom locations in that group. 

I do also understand the cmd.distance command is being used with atom numbers instead of locations, I just left it that way but I do understand that the command does no work this way. Everything else in my program outputs the way I want it to too. 

Here is a copy of my script:

def GKDistance(group1, group2 ):
from pymol import stored
f.write("Distance of group 1 to group 2 is:")
group_average="%f" %group_distance
for i in range(0,len(list1)):
header="Group1 atom %s distance to:" %(location[1]) 
for j in range(0,len(list2)):
distance=cmd.distance('%d','%d') %(location[1],statement[1])
fullstatement="atom %s is %d \n" %(statement[1], 50)

from pymol import cmd, stored
cmd.extend( "GKDistance", GKDistance );

All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net)
Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users
Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net