Room height to parameter

Continuing the discussion from Ceiling height to room parameter:
Hi All,
I’m continuing previous discussion, starting from @john_pierson graph below:


What I need to do is:
-Get the height of each room in the project and put the value to room parameter and then put it into TAG/Schedule. Element could be ceiling, floor or roof of any other.
In my building every room has height, half of them has ceilings, last Level rooms has roofs, so i need to change it a little.

I Apreciate any help
Thanks in advance

1 Like

@Piotrek18 What is the error you are getting on the Element.GetCategory node?

1 Like

@awilliams Error: “Dereferencing a nonpointer”

Seems you’re getting some Empty Lists. You’ll need to filter those elements out before moving on to the next part of your graph, at which point you need to add another check for roof elements.

1 Like

@Nick_Boyts I reproduced the script out of curiosity and intentionally put a section box to get some Empty List items in the RayBounce.ByOriginDirection node, that didn’t get an error on the Element.GetCategory node. Also tried it with throwing in a floor (thinking maybe the Element.GetCategory node didn’t want to handle multiple categories at once) and get no error. The only way I could get the same error is adding a null value, but the preview on Piotrek18’s flatten node doesn’t show any nulls. :thinking:

@Piotrek18 if Nick’s suggestion to filter out the empty list items before that node doesn’t work, could you possibly share a stripped down version of your Revit model?

1 Like

Was your Empty List the first index? :wink:

1 Like

Nope :see_no_evil: you’re right! Returns the error if Empty List is first, but not if its later. Mind explaining that one to me? :rofl:

1 Like

Empty Lists and Nulls are notorious for breaking functions when they are the first item. Not really sure why, but it does come up every so often. Just means you have to filter the elements before applying a function.

1 Like

Hi @Piotrek18 ,
there’s a node in the Data-Shapes (Version 2017.10.1) package that might make this easier for you: “Raybounce on link category”. I should rename it because you can set wether it only bounces on linked elements or not via the input “BounceOnLinksOnly”.
You can feed it your list of categories and it will return the first element of the given categories the ray bounces on :

2 Likes