Applying sorting order of one list of lists on another list of lists

Hi, I’m fairly new to Dynamo and Revit, I hope I’m gonna be specific enough in my questions

I’ve been trying to find out how to sort all sublists in a list with the same defined sorting order.

More precisely, the goal here is, once all parameters of all elements of a certain type have been taken into dynamo, and separated into two sublists, one containing all names, the other, all value, to sort the name list using the -sort- node, and to have the list of value follow that order, so that the index of names and values keep matching in order to write them in Excel later.

On a side note, I’m pretty much confused by this


I find it impractical to have to select an element to get its type instead of just picking the type from the start, any quick fix?

Thank you,

Alex

Hi @agilbertN79F9 ,
you could use sortbyfunction and parameter.name to sort your list of element parameters :

not sure why you don’t get expected results with Family types :

Thanks Mostafa, I’ve tried but it doesn’t seem to fit well in my routine, though I’m not 100% certain I connected it right
The error display is “refers to a non pointer”

I’m gonna try a different approach to the result ans see if I can bypass the problem.

You can also try a great node from Clockwork: List.SortListOfLists. input a bunch of lists, give the list index you want to sort by and the other lists will be sorted accordingly:

You just need to set the lacing of SortByFunction to longest because you have a list of elements :

1 Like

It works!

Thank you SO much!
I’ve been trying to figure out what was wrong since yesterday and didn’t think once about lacing!

Have a great day!

1 Like