Iterating an Index in Dynamo Python Script

Hello everyone,

I am working on my first script in Dynamo, it calculates the intersection between two geometric elements (pipes) and joins them using elbows. My challenge is with automatically iterating over an index in the list of elements.

I want to change the index value from 0 to 1, 2, and so on, without manually adjusting a slider or input. The goal is to automatically iterate through the list and process each element sequentially based on the number of items in the list. (The code block that I want to iterate is in the bottom of the attached image)

Is there a way to automate this index iteration in Dynamo, especially within the Python script or using a external node? Any tips or solutions would be greatly appreciated.

Thank you in advance for your help! :smiley:

You should be able to use the list.map node to iterate the function? :slight_smile:

We need to see more (your specific data structure and python code) to be able to give you any real input. You can use list levels with nodes to structure the iteration of input values or you can write your python code to handle your list structure. Both should be simple enough solutions, it just depends on what you have.

Hello,
First of congratulations on your first script! :confetti_ball:

Lacing operations can be also handy. To use a lacing operation with Python scripts, you need create a custom node. I would suggest you have a look at this topic. But we need a little bit more context about when you want to try that operation and between which nodes.