almost 7 years ago by Frederico
Hello, i had follow the same steps in the video but my loop shows this error: Runtime error (TypeErrorException): len() of unsized object Traceback: line 19, in script I tried all the things other people did here in the questions but it doesn't work. Have no idea how to fix it. Can anyone help me? The script is in the answer below.
Arie Willem de Jongh almost 7 years ago
Hi Frederico!
I have no idea.... I tried your code and it ran as soon as I set the type hint for the "curves"-input to curve. It seems that the variable shatter is empty, the one you set on line 14. That's why the error, because you can't iterate over a Null value, but I'm not sure why, it could be the two inputs you providing at line 14, the curves or the split variables. Check if those exists and also if shatter is a Null value (empty) or has a value assigned to it.
Also could you try different curves to see if that might be the problem?
Cheers,
Arie
Frederico almost 7 years ago
import ghpythonlib.components as ghcomp
domrange=ghcomp.Range(1,samples)
curvature=ghcomp.Curvature(curves,domrange)
circle=ghcomp.DeconstructArc(curvature[2])
logarithm=ghcomp.Logarithm(circle[1])
addition=ghcomp.MassAddition(logarithm)
division=ghcomp.Division(logarithm,addition[0])
domains=ghcomp.ConsecutiveDomains(division,True)
decompose=ghcomp.DeconstructDomain(domains)
split=decompose[0]
shatter=ghcomp.Shatter(curves,split)
ptA=[]
ptB=[]
ptC=[]
for i in range(0,len(shatter)):
divCrv=ghcomp.DivideCurve(shatter[i],2,False)
pt1=ghcomp.ListItem(divCrv[0],0,False)
ptA.append(pt1)
pt2=ghcomp.ListItem(divCrv[0],1,False)
ptB.append(pt2)
pt3=ghcomp.ListItem(divCrv[0],2,False)
ptC.append(pt3)
arcs=ghcomp.Arc3Pt(ptA,ptB,ptC)
segments=arcs[0]
a=curvature[2]