Pyhton create containerCOMP

Hello,

first post here. Looking into how to dynamically create containers from a textDAT script, starting from here:

op('project1/').create(containerCOMP,'container5')

This code gives me an attribute error (NoneType has no attribute ‘create’), even tough it seems consistent with what is described in the wiki?..

Ok, solved it by going up a level (scoping problem). Now the issue is aligning the dynamically generated container COMPs inside the parent containerCOMP…

AND getting a python error while assigning the height value of each container from a table value.
it seems that this can be read (within a while loop), but not set:

op('container1/container'+c).par.h.val=op('table1')[count,0]

Since it returns an error:

Putting it inside a float or int expression does not solve it.
Oddly enough, each height is set correctly, but I’d like to clear the error before coding further.

Anyone?

op(‘/project1’).create(containerCOMP,‘container5’)

you had “project1/” instead of “/project1”

Scoping can be confusing in the beginning, so thanks for that!

“Putting it inside a float or int expression does not solve it.”

Do you think its failing for one particular instance?
Sounds like op('table1')[count,0] is failing on one row, if its working for other cases.
Try printing out the value before assigning it in your script.