Run a function once a time per element

Hello All,

I’m new to Dynamo and I’m having a hard time to perform a flow calculation on the pipes.

I want calculte the upstream flow based on downstream flow.

What I wnat to do is calculate the flow rate, but for this, I need the number of the downstream flow, so I need that the function run once a time per element.

I think there something wrong with the node ‘LOOP’, because when I run the dynamo, he never completes the rotine.

Any help would be greatly appreciated!!!

I’ve tried also with the node ‘List.Map’, but it didn’t work,

any suggestion?

It would be helpful to provide the dyn alongside a minimal working example rvt, as it’s hard from a screengrab alone to see what you are trying to achieve.

Do you really need to use LoopWhile? If you just want your custom node to act on each pipe in turn, why just feed the list of pipes into the custom node directly? Dynamo will process it for each pipe in turn.

I don’t know what the intention of the List.RestOfItems is at the start of the custom node, it’s not connected to any inputs?

Thanks for reply,

But I’ve already tried to do a custom node, but I don’t know what I’m doing wrong!

Again, hard to say exactly without seeing the dyn.

Why does your custom node take all of the elements, but then also query them again from within the node? Each time the node runs, it will query all of the pipes again which seems inefficient. You’re mixing and matching actions on individual elements with the whole list

I did it because in my custom node I need pick up all elements to provide all the flow rates in downstream.

Because, if I got it right, the custom node will run one element at a time, so if I don’t do that, the node will pick just one element and I won’t have all my downstream flow.

The picture shows what the dynamo is for

Can you explain what you’re trying to accomplish here? Revit already calculates flow in pipes. Why do you need to do it with Dynamo?

Because I can’t connect the pipes with the boxes.