Hi Alex,
Tony's suggestion is excellent if you are trying to selected the entire connected fragment, but from the command you're currently using it seems like you are only trying to select the atoms directly bonded to the currently selected atom.  If so, then this Python code will do that:

from chimerax.atomic import selected_atoms
selected_atoms(session).neighbors.selecteds = True

If you put the above into a file whose name ends in .py (e.g. "sel-bonded.py"), then you can use ChimeraX's open command to open that file, which then runs the code.

--Eric

Eric Pettersen
UCSF Computer Graphics Lab


On Sep 10, 2024, at 12:41 PM, Alexander Lee via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:

Hi! I want to select all covalently bonded atoms to my selected atom. Is this possible? Currently, I'm using the command

select @{atom_name}; select zone select 2

It works, but I'm worried about accidentally catching any stray unconnected atoms when doing this in batches of pdbs. Thanks!
_______________________________________________
ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu
To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu
Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/