Notifications
Clear all

[Closed] Adding Objects to Array/By name

Hi all,

Just a bit stuck, I’m trying to add all objects with a certain name to an array but am having difficulties.

What I’ve got is

select $*Hat*
HatArray =#($)

But this doesn’t seem to be working?!

What am I missing here?

Any help appreciated.
Thanks

2 Replies

If you want to convert a selection to array, use either selection as array or getCurrentSelection(). $ returns either undefined, a single node or live selection-set object (based on the number of objects currently selected), while selection can cast to array in all these cases. In fact, here you don’t have to select anything, HatArray = $Hat as array is enough.

Awesome, thanks! That helps alot!