Creating multiple lines between points of the same index number but of different groups

Hi all,
I am trying to create a series of lines connecting points with the same index number but are parts of different groups.
Currently I can only create the lines by indexing a paticular number from each group and then flattening the output to create lines between the points (image attached shows this for index 1).
I want to be able to create these lines for all indexes, and would like it to be as automated as possible, but as yet can’t work out how to.
Apologies in advance if this isn’t clear or is incredibly simple, im relatively new to rhino and grashopper

Grasshopper2 Grasshopper1

Is there a way i can make my problem clearer? I guess i need to be able to sort the points such that each desired line series is within a group. I tried sort points but the coordinates of the points i require in one group don’t share a common x,y or z value. Is there a way to combine the same index of different groups into a seperate group, of varying size.
Any and all help would be greatly appreciated.

Can you share your GH file ?

Of course sorry. The GH file is quite large but i’ve attached an indication of where the relevant code is located.
Thank you so much. (210.0 KB)
AnnexBambooRoof.3dm (41.4 KB)

is this what you are seeking ?