Error with empty lists

#1

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.

#2

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

#3

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

#4

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”?

#5

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.

#6

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
#7

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.

#8

Hi @inleiva

Try this:

#9

It generates the same problem