Hello Dr. Louise,
There is another question after i figure out my last concern.
Firstly, I created two demension arrays, such as:
array_test=([[0,0,1,0,0,0,1,0],[2,2,1,1,0,1,1,2]])
Node_index=([[],[]])
then, tried to create two yarns like this:
sx=3.0
h_weft=0.3
textile=CTextile()
for i in range(2):
yarn = CYarn()
for j in range(8):
if i-1<0:
N[i,j]=XYZ(j*sx,0,array_test[i,j]*h_weft)
yarn.AddNode(CNode(N[i,j]))
textile.AddYarn(yarn)
elif i-1>=0:
N[i,j]=XYZ(j*sx,0,array_test[j]*h_weft+N[i-1,j].z)
yarn.AddNode(CNode(N[i,j]))
textile.AddYarn(yarn)
AddTextile("double yarns", textile)
When i run this script, TexGen showing the TypeError: list indices must be integers, not tuple.
Could you please give me support for this topic?
Have a nice day!
Best regards!
TypeError: list indices must be integers, not tuple
Moderators: Martin, Developers
Re: TypeError: list indices must be integers, not tuple
Hello,
It's difficult to see what's going on without the indentation - maybe you could insert as code on another occassion.
My guess is that the problem is where you are trying to set up the value for the nodes, but it's difficult to tell. This is a Python programming issue rather than a TexGen problem so you need to try to understand what the error message is telling you and look at the code line it's pointing to.
Sorry not to be more help,
Louise
It's difficult to see what's going on without the indentation - maybe you could insert as code on another occassion.
My guess is that the problem is where you are trying to set up the value for the nodes, but it's difficult to tell. This is a Python programming issue rather than a TexGen problem so you need to try to understand what the error message is telling you and look at the code line it's pointing to.
Sorry not to be more help,
Louise