List merging by number

Hello dynamo community.
Is there a way for the lists to match each other between different families.
i made a dynamo graph for positioning panel holes to positions of air terminal and lighting fixtures families. everything works perfectly, when I place the lamps and diffusers in order, from left to right.


However, when I set them up randomly, everything falls apart.

Can anyone give me some advice, with which nodes can I solve the problem?
Thanks :slight_smile:

Try to order the families before placing the panel holes (You do this with dynamo right?)

Based on the images you need to order de rectangles (with lamp and rectangle circle thingies) based on X and Y. Try getting their Location with Element.GetLocation and reorder with this info everything based on X and Y.

If you can already show us you current Dynamo process, we can help you more effective

First run:


Second run:

This is what I want and its look nice, but when I mix diffusers and lamps, I get this :slight_smile:

The first example works in theory but in practice I will never model like that and it will not be good. There will always be some changes in the model and then will be a change of order. There is also a problem if a some panel is skipped. Panel holes are voids in family and they have dimensional parameters Rec_X1 and Rec_Y1.

Can anybody help please? :slightly_smiling_face: