THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 07/10/2010 at 09:26, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 12
Platform: Mac OSX ;
Language(s) : PYTHON ;
---------
I'm learning how to iterate through a container to get its IDs and Values.
Question: Why do I not see the double underscore used in the example code, if the example code is supposed to be an example of how to use the BaseContainer.__iter__() function?
The SDK lists this member of the BaseContainer class as a way to iterate through the container:
BaseContainer.\__iter\_\_
()[](file:///Users/thuesen/Desktop/Python/modules/c4d/BaseContainer/index.html#BaseContainer.__iter__)
The BaseContainer is iteratable so just use it like in the following example:
def iter_container(bc) :
for index, value in bc:
print "Index: %i, Value: %s", index, str(value)
Btw, the print line doesn't work. It seems to work if it's changed to:
print "Index: %i, Value: %s" % (index, str(value))
Thanks for any help,
Arik