# Match list structure between two list

**URL:** <https://forum.dynamobim.com/t/match-list-structure-between-two-list/95588>\
**Category:** Lists-Logic\
**Created:** [November 16, 2023, 6:21pm UTC](https://forum.dynamobim.com/t/match-list-structure-between-two-list/95588 "2023-11-16T18:21:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![y.martinez](https://avatars.discourse-cdn.com/v4/letter/y/3ec8ea/32.png) [@y.martinez](https://forum.dynamobim.com/u/y.martinez)\
**Post date:** [November 16, 2023, 6:21pm UTC](https://forum.dynamobim.com/t/match-list-structure-between-two-list/95588/1 "2023-11-16T18:21:17Z")

</div>

Hello dynamo community

I have a problem with the structure of two list. I need do match the both list, but in the structure of the firts one (see imagine). Actually, I don’t have idea how do that, I’m trying to do with nodes of list but I can’t. If, you know how to do this, I would greatly appreciate your help.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/5/c/5c6ef8d9a4f5ae78c0c1bd0689793e900cbc8db1.png)

Greetings

---

<div class="post-metadata">

**Author:** ![pyXam](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/pyxam/32/163009_2.png) [@pyXam](https://forum.dynamobim.com/u/pyXam)\
**Post date:** [November 16, 2023, 6:36pm UTC](https://forum.dynamobim.com/t/match-list-structure-between-two-list/95588/2 "2023-11-16T18:36:14Z")

</div>

> [@Change list structure to match another list structure](https://forum.dynamobim.com/t/change-list-structure-to-match-another-list-structure/27451/16):
>
> Seems to be a problem with my computer, my GitHub keeps logging out on its own immediately and when I try to relog in, an error page pops up. I will try when I get home. For now, this is the cleaned up version: """ LIST : MATCH LEVELS - a dynamoPython script, visit the website for more details https://github.com/Amoursol/dynamoPython """ \_\_author\_\_ = 'Kenzo Bird - birdkenzo@gmail.com' \_\_dynamoforum\_\_ = 'Kennyb6' \_\_version\_\_ = '1.0' """ Script to match structure of one list to another. IN[0] mu…

---

<div class="post-metadata">

**Author:** ![Nick\_Boyts](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/nick_boyts/32/76313_2.png) [@Nick\_Boyts](https://forum.dynamobim.com/u/Nick_Boyts)\
**Post date:** [November 16, 2023, 7:25pm UTC](https://forum.dynamobim.com/t/match-list-structure-between-two-list/95588/3 "2023-11-16T19:25:21Z")

</div>

You want the list of solids to match the list of surfaces? You’ll need to provide more information and maybe reevaluate what it is you’re trying to do. You add more surfaces to the initial list (which changes the structure), flatten (which changes the structure), and then transpose (which changes the structure). You need to keep track of all the things you’re doing to the initial list and how that changes the structure in order to understand how to maintain that structure.

In this case Flatten is the big one, since it completely removes the structure you had. If you want to maintain the original structure then you’ll either have to avoid flattening or you’ll have to reconstruct it if your logic would allow that, which I think it would in this case.

The better option is always to maintain list structure throughout the logic, which I think is also possible here.

---

<div class="post-metadata">

**Author:** ![christian.stan](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/christian.stan/32/166296_2.png) [@christian.stan](https://forum.dynamobim.com/u/christian.stan)\
**Post date:** [November 16, 2023, 7:32pm UTC](https://forum.dynamobim.com/t/match-list-structure-between-two-list/95588/4 "2023-11-16T19:32:46Z")

</div>

Hi, a ListCount based on @L2 and ListChop on your solids with this same list

Sincerely  
christian.stan

---

<div class="post-metadata">

**Author:** ![y.martinez](https://avatars.discourse-cdn.com/v4/letter/y/3ec8ea/32.png) [@y.martinez](https://forum.dynamobim.com/u/y.martinez)\
**Post date:** [November 16, 2023, 7:40pm UTC](https://forum.dynamobim.com/t/match-list-structure-between-two-list/95588/5 "2023-11-16T19:40:13Z")

</div>

It worked perfect. Thank you very much.

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/3/1/3175e8f26ffe7a25776aee3179013fdf6df43e40.png)
