Search in one list and add a corresponding value from another list

Hi, guys!

My first post to this forum…

I want Dynamo to calculate the bottom elevation of my walls, but I need some help to set up the script right since I am fairly new to Dynamo.

So far I have made/imported three lists: A list of my walls base constraints; a list of my walls base offsets; and a list showing each levels elevation.
The two first lists are longer than the last one, since I have several walls for each level.

Now I want Dynamo to loop through the list of base constraints and assign the corresponding elevation value, so I later on can add the offset to get the bottom elevation I am looking for.

So, how can I make Dynamo search in one list and get corresponding values from another list that has an unequal length?

I hope you understand what I am asking. And I would be grateful for any help or a link if a post with a similiar question exists, after I have searched a solution for this topic a couple of hours.

Best Regards
Lars

Can you show us what you have done so far? Are you just looking for the lowest point of a wall? If you could you use a BoundingBox and get the minimum point?

Thank you for reply, Steven. I haven’t had time for looking more into this the last two weeks.

Actually, I am looking for both the lowest and the highest points of a wall, but I presume the procedure would be the same so I just asked for one of them.

I could perhaps use a BoundingBox, but I don’t have any experience with that. I will have to look more into it.

What I have done so far is that I have tried to use the Dynamo script presented in this Youtube video:


And it looked like this:

Here you can see a screenshot of my example project in Revit, but what I don’t like about this method is that it leaves a lot of blue lines and dots:

Revit%20example

With larger projects my 3D views show up all blue. I found out that these blue lines and dots can be turned off by unchecking Generic Models under Visibility Graphic. I’ve also modelled other objects as Generic Models, so I want to keep this box checked.

And here you can see my own attempt, which I don’t know how to finish:

My%20attempt

I want to begin with the list in group 2, compare the elements of this list to the elements within the list in group 3 and retrieve the corresponding value for the levels from the list in group 4. After this is done I want to have a list of 12 elements with only the three different values in the list in group 4. Finally, I can add the values from group 1 to this list and get the bottom (and top) elevation for my walls.

I think I got everything for you.

I am showing two ways to get the Min and Max Elevations. You can chose ether. Not that you would notice but the BBox is probably faster if you are ever pulling data from thousands of walls.

If you right click on a node you can select preview to turn off someone of the blues lines. the node will turn dark grey.

1 Like

I think the bounding box idea is better as it will also handle edited profiles, great work!

2 Likes

Thank you very much! :slight_smile: