Petro,
 
There isn't currently a way to query bonds from within the PyMOL API.  However, you can travel a Pythonic data structure derived from PyMOL's internal state:
 
for bond in cmd.get_model().bond: print bond.index
 
...where the index displayed corresponds to PyMOL's internal atom index...
 
iterate all, print (resn, resi, name, index)
 
--
DeLano Scientific LLC
Subscriber Support Services
mailto:delsci@delsci.info
 
"Not yet a PyMOL Subscriber, but want to support the project?  Email sales@delsci.com to quote your lab, school, or employer.  Thank you for sponsoring this open-source endeavor!" -WLD
 


From: pymol-users-bounces@lists.sourceforge.net [mailto:pymol-users-bounces@lists.sourceforge.net] On Behalf Of Piter_
Sent: Wednesday, October 17, 2007 3:52 AM
To: pymol-users@lists.sourceforge.net
Subject: [PyMOL] is there bond ? How to check?

Hi all
I want to write a script like this:

if there is bond between atom1 and atom2
      do something
elif there is no bond between atom1 and atom2
      do something else.

But I don't know how to check the bond existence between atoms in Pymol.

Thanks in advance for any idea how to do it.

Petro