Get the item from the list that contains a specific word

Good morning, I’m trying to select a single vertical profile from a list that contains the word “VERTICAL” in the name.
follow my failed attempts

thanks in advance

Use String.Contains instead of List.Contains.

String.Contains will check for strings whereas List.Contains checks for comparable objects.

1 Like

In addition to what Nick said, the List.FilterByBoolMask node will be helpful after you have the list of booleans from String.Contains. The list input would be the Profiles, and the mask input would be the booleans.

Also, you’ll want to use a Profile.Name node after Alignment.Profiles. That way you have a list of strings to check instead of a list of Profiles.

2 Likes

thank you so much for the help, I’m still bad with lists lol

Use FilterByBoolMask like @mzjensen suggested so you don’t manually have to pick the item from a list.

2 Likes

17 / 5.000

I didn’t find this node

Ah sorry, I don’t think it exists :sweat_smile:
Look for CivilObject.Name instead.

1 Like

just to explain the context.
I create several corridors and their vertical profiles
I want to create all the corridors at once instead of creating them one by one.
so i’m doing it step by step

The way you have it works, I was just suggesting you use CivilObject.Name in the place of String From Object. That way you’re getting the profile name directly.

1 Like

now that i understand lol
I’m very dumb

This thread might be helpful.

1 Like

I had seen this post, however I tried to use but the excel node gives error, so I am doing these to replace the ones that are giving error

1 Like