Go from List to Element


#1

This is probably a very simple question, but how do I interact with an element in a list? In my example, I used the RemoveListFromList node to find the unique element ID from two lists of element IDs. I want to write to a parameter for that element.


#2

Very similar I post I think Filter out rooms by parameter “Name” by multiple values. Or isn’t this what you want to achieve? Filter a list based upon another lists values


#3

By default, most nodes will accept a list. Some may require additional management in the way of lacing or list levels, but there’s no issue with using a list as an input. In fact, it’s more common than a single item input.

If you need to get a single item from a list, it’s best to use GetItemByIndex or the DS shorthand. Keep in mind a list with one item will still be processed as a list, not a singleton, so it may be necessary to pull your element from a single length list.


#4

There will most likely be multiple items in the list I want to write to. What I posted was just an example, which shows only a single element.

I made some progress but am am confused by the result I am getting. The result of the RemoveListFromList is correct. However, when I use that result in the List.FilterByBoolMask node, I get a different result.


#5

I think I just figured it out. I changed the Lacing on the String.Contains node to Longest.


#6

You kind of hit on my point of a singleton vs a list with a single item. You’re feeding StringContains a list of a single item so it’s trying to match up with the str input. Changing the lacing to longest has it search for each item in the searchFor list (which is only a single item in this case) so it returns a list (of a single item).

Reducing your searchFor list to a singleton would also give you the correct output, and would actually be the “more correct” solution because it doesn’t change your list structure. That likely doesn’t matter in this case though.


#7

Similar issue…l think?

I have a small list of Elements, and wish to input them into the colour override, yet it is not accepting the input.

Any thoughts?


#8

You are kind of off-topic. Anyways your Color.Red node is light grey: it means it misses an input. Color.Red does not give you “the” red color, but the red component of a color,
You need to create a color by argb (there is a node with a similar name) and use rgb values (0->255) to choose a color. Red will be 0,255,0,0.

When nodes are not working as you expect you should try to read the help section:
image

If you download the Clockwork package you can use preset colors:


Hovering your mouse over the nodes on the left bar will also give you the help section


#9

Many thanks for that.


#10

I am stumped!


#11

Please keep this discussion in the topic you created for the same reason…
And read the information provided for you in there, it is all there if you care to read the what people are replying you.


#12

It is not there to me, even if you know it is.