Error treat with Empty list

Error treat with Empty list


1 Like

@ENGRMA1234 ,

looks like trouble with Listlevels @L…
can you manage it with flatten? you can also “level” flatten.

KR

Andreas

@Draxl_Andreas I don’t want to delete empty list… I want to keep the structure of list for empty and data value …
I want to work those nodes with empty list or any simplified method
… If there a way to work those nodes by replace empty with any object and final replace this object with null …

1 Like

@ENGRMA1234 ,

you can use replace by conditon f.e. (Python)


geometries = IN[0]
dummy = IN[1]

output = []

for i in geometries:
	if i != []:
		output.append(i)
	else:
		output.append(dummy)
		
OUT = output

here a python way…

KR

Andreas

2 Likes

Is there a general replace… I have curves… lines… points… and in the same time don’t give values

Best path forward in these situations is to clean up the data before you process it (remove the empty lists). There is almost certainly a way to do so but we can’t help with that with the information given.

Next best bet will be to use function passing, which will process the lists even if there is an empty list, or if a warning is returned. The bad news is that this will process slower and will suppress all warnings so you will have a harder time with figure debugging efforts.

1 Like

@ENGRMA1234

then you can by true(i) or false(dummy) … but as @jacob.small said you will have to clean up your lists… or find a pattern how to deal with your geometry…

kind regards

Andreas

1 Like

Can I replace Multiple for empty with list in levels
2222