Your first problem can be solved with the help of the Freeze Property modifier in OVITO. You can use it to make a frozen copy of the
Position particle property at frame 0 of the trajectory. You should name this copy
InitialPosition, for example. Next, you can use the Expression Selection modifier to select the subset of atoms across the entire trajectory based on the static
At first, your second problems seems to require a solution based on a Python script modifier, which is only available in OVITO Pro. The CutoffNeighborFinder facility of OVITO seems to be made for this situation.
However, on second thought, you may be able to solve this problem by employing the Compute Property modifier, which is available also in OVITO Basic. Use the following neighbor expression, which yields a non-zero contribution only if particle 42 is within the vicinity of the current central particle:
ParticleIdentifier == 42 ? 1 : 0
The output property of the modifier should be set to
Selection. Thus, this modifier will set the selection flag of a particle to a non-zero value only if that particle has particle 42 within its cutoff range, and to zero otherwise.