Repeating function from different indexes

Hello,
I would like to ask for a way to achieve this:
Is there a way for Dynamo to do a function at index 0, then move onto index 1, until a certain index number or until the last index? I have a huge amount of indexes and I don’t want to run the functions for each one of them but the same function for each index. In other words the function is the same, but the input index and the output result are different. It is like a loop, can you provide any example how this is done?
Many thanks in advance!

1 Like

Dynamo will iterate over the entire list of items given by default. If you want to test a smaller section of data (say indexes 0-3 out of a set of 300,000), pull indexes 0-3 out of the list using a List.GetItemAtIndex, some design script syntax, or similar list functions. Then feed the reduced list into the desired function.

Ι do not want to reduce the list. I want every index of the list to be used by the same function and a way to not rewrite the function every time. I want a way to provide as input for the function the indexes of the list separated. For example index.1 → function (for example a logic nod) → result and then example index.2 → function (for example a logic nod) → result etc. Normally I would have to make it separately with List.GetItemAtIndex but then I would have to rewrite the function (which is huge, about 200 nodes) because List.GetItemAtIndex uses only one value as input while I have to give values for each index.

I really try to be clear as I cannot provide a screenshot because the workflow is huge.

Sounds like a lacing or list level issue, but it’s a bit too vague without a screenshot.

Expand the preview of the node you want to use and all nodes feeding directly into it, zoom in so you can read the preview of the node you want to use, place that node in a readily identifiable group (say a Red color), and then use the export canvas as image feature (button which looks like a camera in the top right of the canvas). Then post the file that saves out.