Problem with complet empty list

Hi I have a big script and at this part sometimes I will have a complet empty list. How can I make a workaround for not having this error.

Please help :slight_smile:

Flatten should remove any empty list.
If your list has blank items use this

It is an empty list with any elements. LIST = EMPTY

Show us the output of your List.flatten node or the warning at the Element.Geometry node.

If found a solution for the Element.Geometry node, but still have the problem in the next node…

Here the List.Flatten does not even have any output. The problem is somewhere up in the graph.

I know. The script goes different ways, and if the script goes another way, then in this way the list is empty. Thats correct so. Is it not possible not to run a part of a script?

Could you change the direction based on some condition… such as by using “If” node.

That is what I’m doing in the hole script, but this nodes need some input, i can not stop them!?!?!?!?

Nope. Passing null values or empty lists is the only way to accomplish this with your current nodes.

Alternatively you can wrap all items in a custom node to deal with the error handling in there.

Hello @Cree-G,

What output do you want to have from Math.Round when the list is empty? The solutions i see are following:

  1. Following workflow below
  2. Just ignore the error if it does not give a problem in the rest of your script

If you do not want to see the error you can in my opinion either

  1. follow @JacobSmall his suggestion, but that will make it more difficult to share your script with other people
  2. make a Python script to replace those 3 nodes
  3. make a zero touch node, but this is also not the easiest way when you want to share with other people

Please correct me if I missed something.

Hi @Cree-G,
Use the workaround like @theshysnail suggested but “Scope If” instead of “If” node that have a bug.
Cheers

HI
It’s not a problem just ignoring the error, but is ugly for other users :unamused:.
Python script would be great, but i’m to unskilled for it.

Kind regards

Hi

There is a way to “hide” the warning notification.
If you create a custom node you dont get a notification.

Hopefully this wil help you.

Cheers

1 Like

Cool.
Unfortunately when i reopen dynamo the new node will not be saved it gets red with message it’s not loaded.
What is when an other user don’t has the node saved/installed?

Kind regards

Welcome to the forum @mj.deboer!

That is what @JacobSmall and I also already mentioned @Cree-G. And you have a point.

To be honest, when i make a dynamo script for clients I prefer mentioning that they can expect this kind of error above making a custom node that they need to install as well + when they share it with collegues those collegues also need to have this node,…

I never had a client who made a problem out of it.

Or sometimes I make a python script for it.

1 Like

Helping your clients learn to manage their packages is another route to take here. It’s not that hard conceptually and the time savings will be well worth it for them and you both. :slight_smile:

2 Likes

That is also true @JacobSmall :slight_smile: