Dynamo List MinimumItem

Dynamo List MinimumItem

endison8
Advocate Advocate
2,927 Views
4 Replies
Message 1 of 5

Dynamo List MinimumItem

endison8
Advocate
Advocate

Hi everyone,

I was trying to get the lowest room surface by comparing their Z value of center point.

I tried to use "List.MinimumItemByKey" and "List.SortByKey", but both of them didn't succeed.

Finally, I used "filterbyboolmask" to do the job.

endison8_0-1631514755438.png

 

However, I am very confused why the other two methods failed("List.MinimumItemByKey" and "List.SortByKey")?

Can anyone tell me? Thank you very much.

0 Likes
Accepted solutions (1)
2,928 Views
4 Replies
Replies (4)
Message 2 of 5

RDAOU
Mentor
Mentor

@endison8 

 

They are not working for 2 main reasons:

  1. You are using them outside their intended use 
  2. They expect an input which is 1) a function and 2) a variable BUT you are feeding them with a double 

 

Apart from the above you are over complicating a simple graph. If you want to get rooms sorted based on lowest/highest, you can simply use the Top Offset Parameter of the room.

 

 

 

YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


0 Likes
Message 3 of 5

endison8
Advocate
Advocate

@RDAOU 

Hi, thank you for the quick reply.

I'm not sure I get it right but I wasn't getting the lowest/highest room though.

I was trying to get the "bottom Surface" of the room, that's why I want to sort or get the minimum z point value of all the room surface centers.

0 Likes
Message 4 of 5

RDAOU
Mentor
Mentor
Accepted solution

@endison8 

 

Then use the following...you can extract/filter faces (Top face or bottom) >> perimeter curves >> start point >> Polygon.bypoints >> Polygon.Center >> Flatten >> Point.Z

 

  • Then use the node List.SortbyKey ... to sort the Room List from lowest to highest

 

Works better in case the rooms are under a sloped or curved roof

 

RDAOU_0-1631530351981.png

 

 

YOUTUBE | BIM | COMPUTATIONAL DESIGN | PARAMETRIC DESIGN | GENERATIVE DESIGN | VISUAL PROGRAMMING
If you find this reply helpful kindly hit the LIKE BUTTON and if applicable please ACCEPT AS SOLUTION


0 Likes
Message 5 of 5

endison8
Advocate
Advocate

This is GREAT!! Thank you very much!!

0 Likes