All objects in Maya are actually accessible by string.
So when you type
$var = `select -r objectName1`;
Maya will select that object in the viewport.
But $var doesn’t contain anything but a string! It just contains the string name for the current selection.
To iterate in maya, you need to use the polyEvaluate function, which retrieves things like the NUMBER of faces or vertices a polygon has.
Access of individual members of the polygon is by string:
It turns out that the .vtx, .f, and .map are NOT objects. They don’t have a .size() member or anything, they’re just “string addresses”. When you address polyName.f, that’s the first face in the mesh. You have to pass the string address to a function to use it though.
Declaring arrays with a leading 0 doesn’t work.