ScriptSpot home

Forum topic · General Scripting

heirarchy to array

By JokerMartini · 2011-04-29

Description

I want to select the top most parent and then run through its children putting them all into an array.

Comments (2)
Graph

select $* arr = selection as


select $*
arr = selection as array

that should do it

JokerMartini

Got this


fn getAllChildren obj &arr:#() =
(
for c in obj.children do
(
append arr c
getAllChildren c arr:arr
)
arr
)
select (getAllChildren $ arr:(selection as array))