Question about the script to extract part of energy

Hi every one

I use the script to calculate the solute energy in the solution system. The idea of the script is to take the solute in the original xtd file as a set, extract it separately and save as a new trajectory, then calculate the energy by using mesocite/Energy. However, all beads except set were deleted in the extraction process. (instead of existing but not participating in the calculation). I am not sure whether such extraction method is reasonable. If not, what should I do.

Thank you for your help.

Zhang