Using Refinery to search in a list of elements the one with maximun value of a parameter

Hi,
I’m trying to use refinery to search in a list of Revit elements the one with the highest value of a given parameter, but it does give me all the items on the list as possible best solutions.
It’s as if it doesn’t run dynamo again every time the element changes.
Can someone help me? Thanks!
With kind regards,
Eliid

At first glance, I don’t think this won’t really work in Refinery as you have configured it. Post a screenshot of your Refinery input and output settings so I can confirm.

Thank you for your answer! Here it is a screenshot.
I just started using it so if you have a better idea of how to set it up I would be happy if you would help me! thank you!

Unless I have misunderstood your aim, you don’t need Refinery for this task.

If you want the element from the list with the highest value for a specific parameter then use List.MaximumItemByKey. Alternatively you can use List.MaximumItem if you just want the value. If you want the windows sorted by the value then you can use List.SortByKey

I’m not sure which parameter you are searching for so the examples below use Sill Height.

Hope this helps,
Thomas

2 Likes

Thank you for your answer!
I started using refinery with this example, which I thought was simple. The idea is to optimize the choice of envelope elements based on a chosen parameter and change them to another element that has a higher value.
do you think it’s possible to do that with refinery?
Thanks again,
Eliid

It would be helpful to provide more details of what you are trying to achieve. I don’t quite understand what you are trying to optimize for.

1 Like