Trying to change a NULL parameter value

Hi all,

I am trying to list all walls in my model and if they have a NULL Fire Rating (parameter Fire Rating NB as Type) I want to replace this with a 0 (also need to be able to select the walls based on a certain level.

I can find the NULL values ok, but can’t seem to replace them…any help would be great

Fire Plan.dyn (8.1 KB)

Try this

5 Likes

It’s probably not a null, but an empty string. Try searching for that and then replace.

Replace Object.IsNull by == “”

Hi Daniel, I’ve tried your suggestion and probably haven’t understood what you you mean… this is where I’ve got to now

the pink area is where I am trying to replace all value of the Fire Rating NB Parameter that are NULL (that’s what’s reported in the list) but could be an empty strung as another member mention.

the yellow area is where I’m trying to select all Walls and Doors on a chosen Level - can’t get this to quite work. If I only select on Category and attach that, then it works. but the moment i try adding 2 categories. yellow warnings

I’m sure this is so simple to resolve - bu still so new to Dynamo.

I really appreciate any help from anyone on this one.

PS also tried this version which looks for empty strings. Again is finds the walls, but doesn’t replace the empty string with a default value.

Fire Plan.dyn (13.4 KB)

Do something as the following image to replace the empty string with something else.

This is what @Daniel_Hurtubise is suggesting:

1 Like

Thanks Einar and Brendon - both these options worked! :smile:

Finaly question I hope. Is there a simple way to then push the new value back into Revit?

I’ve currently used Bredons version and can see all previously NULL values are now showing “Add Rating”

Really appreciate all you help and time! major Kudos to you both.

I’ve worked through a blank script to set a parameter value (image below) and this worked fine. But when I try and use the same principle on my actual script i get a warning. I imagine this is due to the output having multiple values and that I need to push my parameter value back to only the ones which were empty?

this works fine and the value is given back to the Revit walls (all of them)

Here I want to leave the set values alone on the Revit walls, but where I’ve changed the NULL (empty value to Set Fire Rating) in Dynamo, I need to push this change back into the empty values in Revit.

You need to highlight what the errors are and what are the list structures going in to it because you could be feeding in a string when it requires a number or even the lists do not match so therefore it cannot match the new value with a element.

Hi Brendan,

I hear what you are saying

The error indicates:

Fire Plan.dyn (15.3 KB)

I am thinking that the problem is that I have replaced all NULL values (Which has worked) but now my routine is trying to push all the values back from my list, when what I need to to only push the replacement value back onto the parameters with the NULL…would I be right in thinking that?

You are adding a string into something that can only store a number(looking at earlier posts), so you need to covert the input values to numbers for it to work.

Also you do not have to eliminate the other items as it will replace 120 with 120 so no change.

many thanks Brendan, I get what you are saying. I was working with integer parameters in Revit and not text which would be a string.

So this works and the value are pushed back into Revit.

But where I am trying to only push back a value to an empty parameter, the routine looks like it’s working (no errors displayed) but nothing is actually changed in the parameter value in Revit

Fire Plan.dyn (16.8 KB)

this routine is really giving me a headache lol i’ve done other stuff like converting imported AutoCAD 2D lines into walls and floor by line type and that went straight forward…this however

No worries - Solved - I was being a muppet.

Just dawned on me that I was trying to set a Type Parameter with Elements.IsOfCategory and not Elements.IsOfType

All working fine.

Many thanks for you help with this!

Do you guys Now how to solve this problem i am trying to remove null but keep my list in same sequence but every time join with get element parameter by name it show error or null list " i used clean nulls but the sequence go wrong


Hi All,

There is a video showing how to replace null index in a list.

Dynamo - Replace null in List

I hope this is helpful!