Simple selection

Hi Everyone,

Newbie here, just starting out…can anyone tell me why this process isn’t returning “true” for any view containing the year “2018”. I’m just trying simply to select all views in my revit browser which contain “2018” in the view name.

Hello!

You are missing a couple of things:

  • The data type you are comparing are Elements and a string. You need to compare strings and strings. Get the name of the elements with Element.Name which should return a string.
  • The == comparison requires the two string to be identical, but you are looking for a node called String contains.

2 Likes

Thanks, Einar. How would you even know to think that - if you’re a newbie? It would never occur to me that an element isn’t a “string”.

Dynamo will teach you to think like a programmer, and paying attention to the object types will save you from a lot of trouble. The Object.Type node is very usefull:

Thanks.

Onwards and upwards…more to learn…:vulcan:

1 Like

Hi @BradyLCL

you need to transform views into string and then search for your text,

Thanks Michal…as in all software, there are many ways to do the same thing…I literally tried to match your example, all I did was change the code block value, but it didn’t work…why is that? I’m looking for all my 3D views in my Revit file…

@BradyLCL What does the error says?

Look at my screenshot. It’s exactly the same, but replaces the nulls from the element.name node.

Can you hover your cursor over the small yellow box on that yellow node so that we can see what si the error you are getting?

Why your Element.Name has a warning?

One more thing, can you please connect All Elements of Category node to Watch, so that we can see what is the output you are getting there.

Thanks,
Ritesh

2 Likes

Yes , @Einar_Raknes is right problem are with nulls
I tested on RVT 17,16 …I think we can close this subject


FilterViewsByText.dyn (10.3 KB)

1 Like

Thanks everyone! Matching data types and null values in a list need to be paid attention to…