Simple python question (for loop)

Hello everyone,

I am a beginner in python, here in my code I’m using a for loop to test out some curves (7curves) and it’s working perfectly, but for some reason whatever I do before or after the for loop gets duplicated. For example, I am trying to call the dictionary items and it’s giving me 7 items instead of 1. Even with other functions like rs.curveMidpoint I always get duplicates. I have attached both the Rhino and Grasshopper file with some screenshots.

Best,

Ghadeer

Dic 02.3dm (398.0 KB)
Dic 03.gh (48.9 KB)


Your script is running for each of the items in the data tree connected to x. Try changing x’s param type to list or tree (right click it on the component).