Very good days.
I have a problem that I can’t understand
It happens that I am obtaining all the views of my current project, as you can see it returns some “null” elements and I am trying to use an if to be able to keep those that are not null, I have tried to apply an example with “x”, “–” but it does not identify it as null, why is that???
On the other hand, when the “LIST.CLEAN” node is applied, it is possible to eliminate those nulls, but I am trying to solve it from PYTHON SCRIPT, in short, if it could be solved or am I forgetting something…
My goal is to solve it from PYTHON…
Thank you very much for your time…
Line 43 try: if i is None: it’s a bit more forgiving in that it tests for ‘None’-ness rather than having to equalNone
Alternately use the filter function OUT = list(filter(None, ElemVistas))
Edit I’ve had a look and the nulls are because Dynamo does not have an element wrapper for certain types of view - I cannot work out how to filter in python, so removing nulls after processing in python is the way to go
def ClearList(primList):
result =
for sublist in primList:
if sublist is “”:
continue
elif sublist is None:
continue
if isinstance(sublist, list):
sublist = ClearList(sublist)
if not sublist:
continue
result.append(sublist)
return result