I would like to filter 3D Views by name. In this sample I want to separate all views with ‘Kopia’ in their name. The graph, which works in other cases, e.g.here for levels: Element filter by name - #2 by Renzoj14
would give me an error, I believe when it encounters a ‘null’ in value. Is there a workaround?
Are some of those 3d views view templates?
I’m not sure what they are, they seems to block the script.
After collecting the 3d views, plug in another node called View.IsViewTemplate
. There is an OOTB one or one from Clockwork. That will tell you if they are view templates.
Background - Dynamo does not play well with 3d view templates. (because for some reason there are no wrappers for that data type)
I am more on the nulls…
elements= IN[0]
nulls = []
nums = []
for i in elements:
if i == None:
nulls.append(i)
else:
nums.append(i)
OUT = nulls,nums
The problem is that the String.Contains
node can’t deal with the null as it is not a string. So what we can do is replace the null with a “string version” of it:
I think if you add the little code block with:
name == null? "Null": name;
after the Element.Name
node and put its output in the String.Contains
node it should work.
The one downside is that the Element.Name
node still gives an error.
@PauLtus ,
i recognized null is not Null. It is None… in Python it works well
I know that null in Python is None.
Don’t worry about the capital letter difference between "Null"
and null
(edit for clarification: I just did this so it was easier for myself to differentiate).
The important difference is that the None
/null
is now a string, and thus the String.Contains
node can take this data.