From: Bernhard L. <ble...@sa...> - 2015-05-08 19:57:13
|
Thanks for the quick reply. That works like a charm. On May 8, 2015, at 12:37 PM, Thomas Holder <tho...@sc...> wrote: > Hi Bernhard, > > "delete" strictly operates on object names, not on atom selections. This difference is unfortunately a common point of confusion. > > Here's a delete command which operates on a selection and therefore supports the "not" operator: > > python > @cmd.extend > def delete_by_sele(selection): > cmd.delete(' '.join(cmd.get_object_list('(' + selection + ')'))) > python end > > If you paste this in the PyMOL command line or put it in your pymolrc script, you can do: > > PyMOL> delete_by_sele not obj_final > > Hope that helps. > > Cheers, > Thomas > > On 08 May 2015, at 14:42, Bernhard Lechtenberg <ble...@sa...> wrote: > >> Hi all, >> >> after an extensive pymol session, I ended up with a lot of intermediate objects that I now want to delete so I will only keep my final object. Is there an easy >> way to remove all but one object? I tried the delete command, but something like >> >> delete (not obj_final) >> >> did not work as expected and only deleted obj_final. >> >> Any help is appreciated. >> >> Thanks, >> Bernhard >> >> Bernhard C. Lechtenberg, PhD >> Postdoctoral Fellow >> Riedl Lab >> Sanford-Burnham Medical Research Institute >> 10901 North Torrey Pines Road >> La Jolla, CA 92037, USA >> Phone: 858.646.3100 x 4216 >> Email: ble...@sa... > > -- > Thomas Holder > PyMOL Principal Developer > Schrödinger, Inc. > |