Sorting Items out of a List based on a Parameter

Hi Everyone! Again!

I have created a roundabout way of pulling out data from a List by manually scrolling through the list and telling Dynamo where to cut, If I add or subtract Rooms from my list I have to adjust each of the Code Blocks linked to the List.Slice.

So what I am trying to achieve is more direct/automated way to filter my list. I still want all the info in the same block as the Room I am filtering by but I dont want any of the other types.

Example: If you look in the image below, the left list shows List 110 with Central Sterile under item [0] but it has been sliced from the Right watch list

This should help convey a possible approach …
Note the lacing on List.GetItemAtIndex

The sorting can be further refined, if required.

1 Like

Or you could filter elements by a parameter value before getting their parameters.

1 Like

If I am reading the layout right that will sort everything in order like: A,A,A,B,B,B,C,C,C

But what I am trying to do is separate them into different lists as shown in my image below, what I am trying to improve is instead of manually telling it where i want to slice (the code block and slice list), i want it to slice based on a name or string i give it. That way if i add more rooms i dont have to retype all the code blocks

This is not sorting the list, but it is filtering the list of elements to only include elements (sheets) with the the parameter named Discipline, that has a value of STRUCTURAL.