As usuall it seams to be the simplest ones that are the hardest.

End End Goal is to have more use of loop / while functions to allow itterating through list of items.

End Goal today is simply to creat a def where once can take a close poly curve, and nest a copy of itself with in it rotated by a an amount.

In a one time process this works fine. - code block text below.

PC_1 = PolyCurve.Curves(results);

pts1 = Curve.PointAtParameter(PC_1,0.2);

pts2 =List.ShiftIndices(pts1,1);

ln = Line.ByStartPointEndPoint(pts2,pts1);

PC = PolyCurve.ByJoinedCurves(ln);

and i can string these together in series to nest ever smaller shapes and given amount.

this seams like a waste of steps. So I attempted a simple def when I could loop the process to a given amount of itterations.

I receive no errors, and it appears to finish (dynamo doesnt go into a endless loop) but after much editiing and trial all that appears to return is â€śnullâ€ť

I have completed an approximation of this same defintion swaping all geometry oppertations for math and it will work. Is there a limitation to looping geomotric functions, or am i missing something else.

def test(Geom,Itt)

{

return = [Imperative]

{

//

sequence = {Geom};

i = List.Count(sequence);

while (i != Itt)

{

results = sequence[0];

PC_1 = PolyCurve.Curves(results);

pts1 = Curve.PointAtParameter(PC_1,0.2);

pts2 =List.ShiftIndices(pts1,1);

ln = Line.ByStartPointEndPoint(pts2,pts1);

PC = PolyCurve.ByJoinedCurves(ln);

sequence = List.AddItemToEnd(PC,sequence);

i=i+1;

}

return = {i,results};

}

};