List.Combine and List.SortByKeys as a function - how does it work

Hello guys,

So I am trying to figure out the outcome of List.Combine node used with List.SortByKey node as function below is the pic of the lists and elements. It is a bit complicated and the outcome is all surface hence I couldn’t understand the outcome. Can someone help me?

Could you maybe share this Dynamo file/ the input? Because i also do not understand what is going on here.

I don’t think you’re using the right nodes for whatever you’re trying to accomplish. List.GroupByKey is probably what you need. A better explanation of what you’re after would be helpful.

@Nick_Boyts @Daan
The dynamo file is very big with huge coding in it. I am trying to make a generic bridge modeling workflow for myself. More precisely I am trying to align Pier top with the deck, so that top surface of columns will touch the bottom surface of the deck. Surface you see in the picture is a bottom surface of a bridge deck. i am making a point in the middle of a surface and then measure the distance from the top point of column to that point, which lets to solve the problem. However, I do not understand the logic behind this code, I got help with this part long ago.

If you need the file however you can find it below. But, you will also need other two REVIT family attachements to run the code.
Dynabridge manually_Bridge Body_MSS .dyn (239.5 KB) Pier.rfa (592 KB) 3d line.rfa (356 KB)

I am not experienced in dynamo, and have trouble with managing lists the way i want. I will try to research and try out the List.GroupByKey. But, I am more interested in they way 2 nodes, List combine node with a List.SortByKeys as a fucntion, interact and in the outcome of it. So, I am not exactly searching for a solution or alternative, although more concise coding will be aprreciated, but for logic behind this code and explanation of the outcome

We just need an explanation of the immediate process you’re trying to solve with those nodes. List.Combine is for applying a function across multiple inputs and usually isn’t necessary due to lacing and list levels. SortByKey sorts the input list based of the keys provided for those items. GroupByKey works similarly but groups the items into sublists based on the provided keys.

So, then does it mean that inputting sorted list as a function into List.Combine will result in list one being sorted according to list 2 in List.Combine node? If that’s so its a bit meaningles to even use list combine. since it just does the same thing as a function node.
Regarding explanation of what i wanna do is I am trying to attach top surface of column to the bottom surface of deck, that is attach columns to the deck. However, I got help with the code in this part. Hence, i cannot explain what particularly that small part of code does on the contrary I am trying to figure out what it does. I am trying to understand the logic behind List.Combine, which i feel as an unnecasary node in general. Since the outcome of List.Combine in my case is surface only i can not decipher algorithm and logic there.

List.Combine is essentially for lacing or list levels with nodes that don’t support those functions as-is. As I said, it’s usually unnecessary. This image may be helpful.

1 Like

@arslan.chariyev i actually use the list.combine node in almost all my scripts :slight_smile:

1 Like

I see, can you tell me how did you learn dynamo? I saw your profile and u r very much like me in almost all regards except i am new to dynamo. I would very appreciate a little guidiance. Currently, I am learning through dynamo dictionary and getting help from the forum. I also reverse engineer the custom nodes that i know and use.

Well i learned Dynamo by just having really simple goals and building them into more complicated scripts. Like making a very simple script to change Revit parameters easily. If i would be you, i would search for something that would really want to use yourself or others, something that is actually usefull or saves a lot of time.