ce.selection does not seem treat all objects selected?

Discussion created by pltsltesri on Jun 6, 2014
Latest reply on Jun 6, 2014 by pltsltesri
The script I want to write simply changes an object attribute value for all selected objects but what I find is that it will do 1, I assume the first one it finds, and ignores all of the rest. The case is that I select a number of parcel polygons and run the script, only one has had the "Pop" attribute changed to the value I specify, i.e. 99, the rest of the polygons do not change.
The code is rather simple:
ce = CE()
thePop = 1000
print ce.selection()
ce.setAttribute(ce.selection()[0], 'Pop', 99)

The "print ce.selection()" line does return the proper number of objects but only one gets the Pop attribute modified. What am I missing?