User Tools

Site Tools


command:iterate

Table of Contents

iterate

“iterate” iterates over an expression within a temporary namespace for each atom.

Usage

iterate selection, expression

Examples

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 

Notes

Unlike with the “alter” command, atomic properties cannot be altered. For this reason, “iterate” is more efficient than “alter”.

See Also

command/iterate.txt · Last modified: 2013/08/19 21:00 (external edit)