Notifications
Clear all
[Closed] Filling the listbox with all objects under specified layer
Jan 19, 2023 11:44 pm
Hello, I would like to kindly ask for your advice.
how to fill the listbox with all objects under the specified layer. I also mean objects that are in sub-layers of a sub-layers and so on
I tried it like this, but this only takes objects directly below the specified layer
HelperLayer = layermanager.getLayerFromName "HELPERS"
HelperLayer.nodes &nodes
Helpers = for node in nodes collect node.name
lbxHelper.items = for h in Helpers collect h
thanks for your advice
1 Reply
Jan 19, 2023 11:44 pm
I think the funciton iin this code was posted by denisT on this forum:
(
function GetLayerNodes layer list: recurse:on =
(
layer.nodes &nn
join list nn
if recurse do for k=1 to layer.getNumChildren() do ( GetLayerNodes (layer.getChild k) list:list recurse:on )
list
)
HelperLayer = layermanager.getLayerFromName "HELPERS"
objArr = #()
GetLayerNodes HelperLayer list:objArr recurse:true
select objArr
)