Set RoomParameter from RoomBoundaries Elements

Hello there.
I have the task to include in a room shared parameter (OKFF) the Elevation value -relative to 0,00 Project level- of the Floor right underneath the Room. With this Information I will be calculating together with some other room Parameters other elevations in the Room, like suspended Ceilings and Structural elements.

So the Idea is:

  • Get All Floors that belong to the Boundaries of the Room
  • Divide the values in Finished and Structural Floors.
  • ADD (“Level Elevation” of each set of Floors and and their “Height Offset from Level”)
  • get the Minimum Value of that result for the cases in which I have 2 Floors in one room.
  • In the cases in which I don´t have a Finished Floor in the Room I get an “Empty List” the Value of the RAW Structural Floor should replace the Final Height Value on that List.

My Problem is, that this is how my Replacement Method ends up replacing each Value on 2 separate lists! Ive tried every Level and Lacing combination possible.

I´ve been trying days now and WON´T GIVE UP! Could someone give me a hand out there?
I would really appreciate it.

here a screenshot of the workspace:

I cant upload files as a new user unfortunately. But please let me know I you need further information in order to help me achieve my Goal.
Thank you very much

Here an image of the different elements listed on the script:

Your graph is illegible. You’ll have to export again. Make sure you’re zoomed in enough that node titles are visible when using Export as Image. It would also be helpful to highlight the exact area of your graph that you think you’re having trouble with, along with an explanation (example is even better) of what you’re hoping to get.