Getting maximum value of two variable in Code Block

dynamo

#1

In the code block i want to get the max value of the following variables:

  • B3_Safe W [value by list(5) is: 650]
  • B4_Safe W [value by list(5) is: 850]
    850 should be the answer but i don’t know how to get this answer.
    Can someone help me with this problem?


#2


This probably isn’t the most elegant way to solve something like this but it should work.
Edit:

There’s actually a very simple function for that.


#3

is this what you are looking for ?

List.MaximumItem(Math.Floor(Math.RandomList(10)*50));

http://dictionary.dynamobim.com/#/Core/List/Action/MaximumItem


#4

I’m not looking for the highest number in one list, but the highest number between two list at the same level.


#5


Like this?


#6

I’ve tried your last example and it’s working :grinning:


#7

or like this:

OUT = [max(i,j) for i,j in zip(IN[0], IN[1])]


#8

I found that Dynamo is incredibly flexible when it comes to list inputs as long as you’re being consistent, this is actually pretty simple.

Happy to help


#9

This one is also working.

Thanks all you people. :+1:


#10

You can actually tag a comment as solution so people with similar problems can immediately see how to solve it.