Link Array (directional)
This code simply allows a users to link a selection of objects based on the order of selection. You can use either 0 or 1 to define the direction. That allows you to link everything forwards or backwards. Rather simple code but I figured someone would find use for it.
clearlistener() fn fnLinkArray arr dir:0= ( if dir != 0 then ( reverseArr = for i = arr.count to 1 by -1 collect arr[i] arr = reverseArr ) for o in arr do o.parent = undefined for i = 1 to (arr.count-1) do ( child = arr[i] parent = arr[i+1] child.parent = parent print (child.name + "---->" + parent.name) ) ) fnLinkArray selection dir:0 fnLinkArray selection dir:1