“cmd.get_distance” returns the distance between two atoms. By default, the coordinates used are from the current state, however an alternate state identifier can be provided.
cmd.get_distance(atom1="pk1",atom2="pk2",state=-1)
def get_distance(atom1="pk1",atom2="pk2",state=-1,quiet=1):