# Combine Two Lists of walls as Pair

Hi
I have a question and would be thankful for all answers.
I have two lists List A with six Walls and List B with 8 Walls.

I want to compare the distance between two lists and delete the wall from List B when the distance is less than for example 10 cm.
how can I do that?

my Idea was to merge the Lists so that each wall from List A pairs with each wall from List b

1. how can I make that List
2. is it a good idea?

This boils down to general list management. You can use lacing or list levels to get the distance between all combinations of wall pairings between the two lists. Then you can count how many pairings for each wall are less than 10 cm. Any wall with a pairing less than 10 cm gets filtered and deleted.

Tnx for your answer Nick. I know it seems very easy for you. But I am just starting dynamo. can you be more specific please. here is as far as I am gone.

I would suggest working through the Primer to get a grasp on the basics first. You need to convert the walls to geometry before you can compare locations (distance from each other) and then itâ€™s just a matter of conditional statements and a filter. Show us that youâ€™re making an attempt to move forward so that we can help you take the right steps.

1 Like

Hi Darxl
you selected walls with lengths less than 100 Units. I want to pair up all the walls from List A and B. and find out the distance between them. It seems very easy but I canâ€™t find out how should I make this List.
we have List A and List B, and I want to create List C like this:
List A: A,B,C,D,E,F
List B: 1,2,3,4,5,6,7,8
List C: A1,A2,A3,A4,A5,A6,A7,A8,B1,B3,B3,B4,B5,B6,B7,B8,C1,C2â€¦C7,C8,D1,D2â€¦D7,D8,E1,E2â€¦E7,E8,F1,F2â€¦F7,F8

I used locationcurve of walls

But how can you be sure that these walls are beside each other? shouldnâ€™t we compare 8x8=64 walls together, and how can be sure that the curves are parallel.
my goal ist to delete Innenputz from TrockenbauwĂ¤nde.

Yes. You would compare each item in the first list with each item in the second list. This can be handled with list levels or lacing.

Hi Nick, thanks for your attention so far, it would be great if you can help
here is my script so far
first, I tell you what I wanted
as you can see in the picture below, I want to delete the marked yellow walls and keep the unmarked

I took the geometry of each wall. Draw a line perpendicular to the base wall. If the line length was less than 10 cm, then it means, it comes from the yellow wall that I want to delete. now, how can I use â€śget the item at indexâ€ť to get these walls?

Youâ€™re close. List structure seems to be a bit of an issue. I think `Curve.PointsAtEqualChordLength` is giving you additional list levels where you donâ€™t need them. Try using `Curve.PointAtParameter` instead. That should make it so that `Curve.Length` gives you a list of Walls, each with their own sublist of distances to the other set of Walls.

After you check those distances to be less than 10 cm, youâ€™ll need to see if any of those distances (within each sublist of Walls) meets your condition (`true`). You donâ€™t actually care which Walls are closer than 10 cm, you just need to know that there is a Wall. That should give you a final list of booleans representing the Walls that are too close.

Then you can use `FilterByBoolMask` to filter those Walls.

you mean I donâ€™t need â€śGeometry.doesintersectâ€ť node?

Iâ€™m not sure. Thatâ€™s after youâ€™ve checked against 10 cm, so I donâ€™t know what youre doing with the intersection at that point.

1 Like