Continuing the discussion from Ceiling height to room parameter:
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
@Piotrek18 What is the error you are getting on the Element.GetCategory node?
@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.
@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.
@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?
Was your Empty List the first index?
Nope you’re right! Returns the error if Empty List is first, but not if its later. Mind explaining that one to me?
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.
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 :