Parametrs from Space to Equipment (Empty List problem)

Hello Guys,

I have a big problem with “Empty List”, I try to push parametrs from space to Equipment installed in each one, but if first item on the list is a empty the rule doesn’t work. I try used “Replace Empty Lists” node but it’s don’t work:( Please help me. It’s very frustraiting, I search all internet to find solutions of this problem with no result. When I use “List is Empty” chronology of list are losted. Sorry for my English. Regards!
Below my script:

Hey,

I think this is how I’d approach it… See if it works for you?

I think you’re right that if the first list is empty, lots of Dynamo nodes don’t work properly.

I’m not keen on the boolean filter in this instance, as it changes the list structure, which might be a problem…

I expect lots of people will have better methods than me :slight_smile:

You have to be careful to use the Clockwork ScopeIf+, the OOTB IF doesn’t work & ScopeIf can freeze your graph if you’re not careful.

Hope that’s useful,

Mark

Edit:

You might want a replace Null in there as well…I think you’re going to struggle if your first list has varying nested Empty lists, if your condition is regular then you can set the replacement to a specific arrangement. Otherwise you might need to get into python… Which is going to be quite involved because you need to deal with nesting and lacing… So Python in a custom node would likely be the best way…

Something like:

elementList = IN[0]
replacement = IN[1]

Output = []
for element in elementList:
    subList = []
    if element == []:
        subList.append(replacement)
    else:
        subList.append(element)
        
    Output.append(subList)
    
OUT = Output

Thanks Mark, but my Dynamo and Python knowledge is too small to successfully apply in this case:(

Hey, no worries, try the 2nd graph I posted… then post what you get :slight_smile:

But I didnt understand this Code Block. Where I have to put this to to my graph?

That’s just a test list I used to give me some input… you have your list of Elements…

Ah ok;p Thx, I will try your solutions:)

1 Like