Index of list Cant find the index in the List

Hello everyone, I have a problem to find the index of item in the list, i tried all the methods that came to my mind, but I couldn’t find solution for it, i tried to get the maxiumum length which far from the door and i could get these values , what I have here its a list and the order of the flatten list doesn’t match the original ones ( by the way the main list of the rooms are having a start point from left-top point ), for this reason, I am not getting index values, is there any way to solve it, very appreciated for any help .

17.10.2019 .dyn (110.3 KB)

Hmmm, never used IndexOf with curves…
But have you tried Curve.Reverse? This just changes the Start and End point of input curve.

what is the point of this ? i already have the curve that i need just wants to find the index of them in the Main list

Yup sorry, i missread the issue :slight_smile: . Did you try using levels?

I think too, that you should try it on L2 Level 2 the final node.
image

Or flatten the the L3 list and no need for L2 set

i tried it as well, every possibilities for level and lacing , but this what i got , the last two index are right but the rest is not , because the first item in the flatten list doesn’t belong to the list 0 and so one , so i am looking for a way to order the item down to the belong list up

Can you scroll both the List.Flatten and the Line.ByStartPEndP node box a little bit right, that to show the line coordinates?
Are there repeated, same lines in the Line.ByStartPEndP node’s list?
Do you need that the Line.ByStartPEndP node must keep the structure or can it be flatten?

hey Mate, yes i need to keep the structure of the Line.ByStart list , i also uploaded the dynamo file if its gonna easier for you to take a look around .

List.IndexOf node returnes only the index of the first occurrence.
https://dictionary.dynamobim.com/2/#/List/Inspect/Action/IndexOf
Unfortunately I don’t know the answer yet.

My idea is that you first sort the matching lines, than get the list of the indexes:

yes thats right but i didn’t know which criteria should i use it to sort or match the element to the list

If all the parameters of the line is matching, it will be equal.
If it’s not that easy job and the lines just nearly the same, you could Round the parameters value, by getting the start,end points or X,Y,Z coordinates out of the line and match/sort by those values.
Or you could use the new Equals Node with Tolerance Input node

(I haven’t tried it yet)