Sometimes, it is helpful to get the index (number starting from zero) or serial (number starting from one) for the currently drawn part of the molecule in vmd. For example, it you want to create an index file for a given system, or if you want to split up your system into parts for whatever reason.
Let’s assume you have only one molecule loaded and you now see the part of the system in vmd that is of interest to you. Now switch to the vmd console and enter
[atomselect top [molinfo top get selection]] get serial
or
[atomselect top [molinfo top get selection]] get index