def atom_distance(spec1, spec2):
    from chimera.specifier import evalSpec
    atom1 = evalSpec(spec1).atoms()[0]
    atom2 = evalSpec(spec2).atoms()[0]
    d = atom1.xformCoord().distance(atom2.xformCoord())
    return d

from chimera import runCommand
if atom_distance('#0:15.B@C4', '#0:7.A@N3') >= 10:
    runCommand('display #0:SPM')
else:
    runCommand('~display #0:SPM')
