From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Sat Mar 11 2023 - 23:49:00 CST

On Sun, Mar 12, 2023 at 12:28 AM Strahs, Dr. Daniel Bernard <
dstrahs_at_pace.edu> wrote:

> Thanks Axel!
>
> I guess that I'll capture the molecular ID of the newly created top
> molecule.
>

I forgot to mention: "set mol [molinfo top]" will also work, if the
molecule was just created. Capturing the return value of the mol command is
the safer option, though. That is what I am usually using in my VMD Tcl
scripts.

> Thanks for the tip about the animate command; much appreciated!
>
> Dan
>
> ------------------------------
> *From:* Axel Kohlmeyer <akohlmey_at_gmail.com>
> *Sent:* Sunday, March 12, 2023 12:23 AM
> *To:* Strahs, Dr. Daniel Bernard <dstrahs_at_pace.edu>
> *Cc:* vmd-l_at_ks.uiuc.edu <vmd-l_at_ks.uiuc.edu>
> *Subject:* Re: vmd-l: Two questions: reordering molecule IDs and deleting
> frames with TCL commands
>
>
>
> On Sat, Mar 11, 2023 at 6:34 PM Strahs, Dr. Daniel Bernard <
> dstrahs_at_pace.edu> wrote:
>
> Hi all:
>
> Two questions, which I can't identify in the manual or various tcl scripts:
>
>
> 1. VMD Molecule IDs are assigned at loading. I know the top molecule
> can be assigned. Can the numerical molecule IDs be reassigned by command?
>
>
> No. Those are designed to be unique. There is a counter that gets
> incremented whenever a new molecule is created.
> This is similar to how atom selections get a new (function) name for each
> new selection.
>
> So to write "portable" scripts, you have to capture the molecule id on
> creation as the return value of the "mol" command (set mol [mol new
> somefile.psf]; mol addfile somefile.pdb $mol) same as with the more
> commonly seen "set sel [atomselect top all]".
>
>
> 1. You can delete the loaded frames for a given molecule using the
> pulldown menus. Is there a corresponding command to do the same?
>
> You can use the "animate" command for that. "animate delete beg 5 end 10
> mol $mol"
>
>
>
> Thanks!
>
> Dan Strahs
> Biology Dept
> Pace University
>
>
>
> --
> Dr. Axel Kohlmeyer akohlmey_at_gmail.com https://urldefense.com/v3/__http://goo.gl/1wk0__;!!DZ3fjg!63JJkLMQHXLZBkM7T2z5jbINYmp-_zdKkJOhFVzj_StJakd4CCRMUOpe00UpqNL5_QV60HkCcFVC8tKeYQ$
> <https://urldefense.com/v3/__https://nam12.safelinks.protection.outlook.com/?url=http*3A*2F*2Fgoo.gl*2F1wk0&data=05*7C01*7C*7C3d16c69fd57b46cb582708db22b9f0c9*7C0799c53eca9a49e88901064a6412a41d*7C0*7C0*7C638141954233731615*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C3000*7C*7C*7C&sdata=Pw*2FLDI9jrmUH4QRrCrLRAP6AIHBqnjH0UF4tiL*2BHHLU*3D&reserved=0__;JSUlJSUlJSUlJSUlJSUlJSUlJSUl!!DZ3fjg!63JJkLMQHXLZBkM7T2z5jbINYmp-_zdKkJOhFVzj_StJakd4CCRMUOpe00UpqNL5_QV60HkCcFXXB_BtJw$ >
> College of Science & Technology, Temple University, Philadelphia PA, USA
> International Centre for Theoretical Physics, Trieste. Italy.
>

-- 
Dr. Axel Kohlmeyer  akohlmey_at_gmail.com  https://urldefense.com/v3/__http://goo.gl/1wk0__;!!DZ3fjg!63JJkLMQHXLZBkM7T2z5jbINYmp-_zdKkJOhFVzj_StJakd4CCRMUOpe00UpqNL5_QV60HkCcFVC8tKeYQ$ 
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.