How to collect only the first items in a list up to a certain point of comparison

hi guys …

as in the image to the side I am using the (“MEPover pipe upstream node”) that generates four lists according to the circle (1) and according to the watch in the circle (2)

as in the image to the side I am using the “pipe upstream node” that generates four lists according to the circle (1) and according to the watch in the circle (2)

I would like to collect the values ​​from list 0, contained in the watch (2) of the image.

[0] up to [n …] indexes,

[n …] = the value contained in the object.identity node.

and create a list. in this case the list would have three values ​​up to the indexes [n …] which contains the identity value

in other words, it is necessary to collect values ​​within a list until the identities match this must be done for the four lists in the circle (1) of the image

Hi @Tiago

Welcome to Dynamo Forum!

Use List.FirstIndexOf node to get first item in sublist:

hi bro

I need to collect the items until they are the same

put in your photo I need to collect indexes [0], [1], [2], if [3]? = id = TE BSP ,stop the count and create a list L@ [0],[1],[2]

PROJECT

Hi Tiago,
It seems like you want to get the pipe until the point where it reaches a pipe fitting with more than 2 connectors (a tee). Here is a way to achieve that:

1 Like

Good Morning

yes it would be a Tee in this same example I will need this to happen at the hydraulic pump, or any other point I got in a different way, as you can see, now I need to counter the flow I will try another post and see if I can reach my goals
follow below how I managed …

1 Like

how can i do the same but in place of a tee be a weld?
start pump finish tee or finishi weld?

Good morning in this example you selected a hydraulic part and went to the nearest tee.

My current problem is to select 10 hydraulic parts to reach a reservoir that has more than 6 connectors.

this should be separated into lists - sublists