Error with empty lists

Hi!

I have a code, that splits elements according to their type. When I have an empty list, the PolyCurve.ByJoinedCurves and Surface.ByPatch make Dynamo collapse.

Is there a way, that when the list is empty, the code stops at that branch, or solving that the following nodes work with empty lists?

I attach a picture with the part of the code. “Figure of only rectangle angles” is the node that is currently empty. And warnings appear on the two following.Also, goes the error that appears that Dynamo crashed.

Use and List.IsEmpty node and a FilterByBoolMask node to remove the empty lists and stop your issues.

I put it bewteen in between like you said, but it will give an empty list and crash the other nodes. I have only problems with thos two particular nodes

1 Like

You want to use the Out port of the BoolMask not the In since you are looking for Empty lists. But, it looks like the node is reading Empty for both. Can you show result window for the node just before “rectangle angle”?

It is the same result as in List.FilterByBoolMask. It just gives empty lists. Only those two nodes shown have a problem with empty list.

Why are you feeding it empty lists? What do you expect it to do with them? Would you show us more of the graph with result windows open after running it?

3 Likes

I import spaces from a revit file. They can be either only rectangular rooms or a mix of that with rooms shaped like L (with 90 or 270 degres).

When we have both cases, the code works perfect. But when we have only rectangular room cases, it breaks the whole dynamo, because those two nodes cannot work with empty list.

After that that code simply calculates properties and inserts elements.

Hi @inleiva

Try this:

It generates the same problem