Recreating original list

Hi, I recently started using dynamo and I ran into a problem…
I’m working on a project where I generate rebar in concrete beams.
To determine whether or not the rebar should be extended into the subsequent beam I offset the beginning and end surfaces, create a point and check of the point is in a bounding box (which is created by the selected beams).
If the point is in a bounding box, the surface of the beam is extended by a fixed amount (I am planning on retrieving this as well, but that’s something I will figure out later).

I have a list of surfaces, beginning and end, of every beam.
I split these into all the beginnings and all the ends.
After the checking and ofsetting I have 4 lists; 1 containing offset beginning surfaces, 1 containing normal beginning surfaces, 1 containing offset end surfaces, and 1 containing normal beginning surfaces.
My problem is that I want to merge the list in a way that I recreate the original list, so that I have a beginning and end point to generate rebar to.
So far I havent been able to get them back into the original list structure.

Does anyone have an idea?

Thanks in advance.

Here’s a screenshot of the beams with the offset surfaces.

Select element test.dyn (57.6 KB)

Edit: I’ll add a revit file to recreate my situation (Revit 2019)
Beams.rvt (2.1 MB)

so you want to collect all info related to the beam in 1 list ? and this for all beams right ?

No, I only need the surfaces.
Original list
This is the list, I check which of these need to be offset, but then I end up with 4 lists (red is beginning surfaces, blue end surfaces)

“List.Create” all 4 lists, then use " transpose" , i think it would be as you want

This does put them into the same list, but all on their own, and not grouped with the corrosponding surface of the same beam…

have you “flatten” the lists before using "List.Create "?

I used levels, but the flatten doesn’t solve the issue of mismatched surfaces.

With flatten and chop I can recreate the idea of the first list, but the entire logic behind it is gone…
The first two surfaces in the list belong to two entirely different beams.

flatten each 4 list before input them to list.create
like this concept

This does nothing for the combination of beginnings and ends as you can see in the screenshots.

I’ll add the revit file so you can see what I mean
Beams.rvt (2.1 MB)

Hi @Timdarkloto
I think you should use the If node after filtering by bool mask : if true get the offset point, if false get the end point.

In fact, what you want to do is to replace the beginnings or endings points by a condition, isn’t it ?
The condition is that the offset point intersect the beam.
There is a node ReplaceByCondition, maybe it can be usefull.
It is not easy to recreate the original list in your current graph because the index of the surfaces are lost at the end.

Maybe this will help you,

Select element test_with dictionary.dyn (113.4 KB)
I uses the dictionaries features given it allows to replace several items.

1 Like

You sir are amazing.
I never really got dictionaries that much, but I’m much closer to understanding them now.
Thank you so much!