Notifications
Clear all

[Closed] wildcard on variable?

 em3

Hi!

I am trying to create a collection from an array. This doesn’t work.


myarr = #("steel_001", "ground_001", "person_001")
currentLayer = for o in objects where matchpattern o.name pattern:myarr[1]* collect o

How can I place a wildcard on an array value?

Thanks!

Dave

2 Replies

pattern: needs a string, just a * without quotes is the multiplication operator

myarr = #("steel_001", "ground_001", "person_001")
currentLayer = for o in objects where matchpattern o.name pattern:(myarr[1]+"*") collect o
 em3

thank you, zbuffer!