THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 03/03/2011 at 23:10, xxxxxxxx wrote:
Hi Seb,
I still have problems with the code, it worked for a while and now its broken again.
The Python Console gives me:>
Traceback (most recent call last) :
File "<scriptmanager>", line 35, in <module>
File "<scriptmanager>", line 29, in main
TypeError: unsupported operand type(s) for +: 'int' and 'str'
my script is:
import c4d
from c4d import documents
from c4d import gui
def GetNextObject(op) :
if op==None: return None
return op.GetNext()
def main() :
c4d.CallCommand(1024314); # clear python console
c4d.CallCommand(1022604); # open python console
counter = 0
myobject = doc.GetFirstObject()
if myobject==None: return
while myobject:
counter = counter + 1
myobject = GetNextObject(myobject)
gui.MessageDialog(counter + ' Objects in root.')
if __name__=='__main__':
main()
thanks in advance
mogh