"""
Selects atoms inside AutoGrid Box and 
print their residue names
"""
from MolKit.molecule import AtomSet
selection = AtomSet([])
box = self.GUI.VIEWER.FindObjectByName('root|misc|autogpf_geoms|box')
minV, maxV = box.ComputeBB()
for mol in self.Mols:
    for atom in mol.allAtoms:
        if minV[0] <= atom.coords[0] and atom.coords[0] <= maxV[0]:
            if minV[1] <= atom.coords[1] and atom.coords[1] <= maxV[1]:
                if minV[2] <= atom.coords[2] and atom.coords[2] <= maxV[2]:
                    selection.append(atom)
self.select(selection)
print "Residues in the selection:"
print selection.parent.uniq().name
