List with max value

I am trying to retrieve the maximum wall width along with the ID of the corresponding wall.

It may seem like grouping related values/objects into sublists is the best way to maintain a relationship, but it actually makes list manipulation very difficult. Maintaining relationships through indexes of separate lists actually makes things a lot easier. Using something like List.GroupByKey or List.SortByKey allows you to manage two lists independently while maintaining the proper indexing relationship.

2 Likes

Another way is to use List.IndexOf and List.GetItemAtIndex nodes.

Nick’s solution is good though

1 Like