“iterate” iterates over an expression within a temporary namespace for each atom.
iterate selection, expression
stored.net_charge = 0 iterate all, stored.net_charge = stored.net_charge + partial_charge print stored.net_charge stored.names = [] iterate all, stored.names.append(name) print stored.names
Unlike with the “alter” command, atomic properties cannot be altered. For this reason, “iterate” is more efficient than “alter”.
iterate_state | alter | alter_state | cmd.iterate | commands