ScriptSpot

Forum topic · General Scripting

Expand the Active Layer in the Layer Manager

By Linkitch · 2022-11-24

Description

I'm trying to expand the Active Layer in my Layer Manager.
But I cannot for the life of me figure out the correct approach to doing this.

There is an ExpandSelected function in the Scene Explorer Manager, but there doesn't seem to be a way to actually select a layer. There is a .select function in the LayerManager, but this selects all the nodes in the layer.

Does anyone know how to do this?

Comments (5)

.

miauu · 2022-12-02


(	
	sceneExplorer = SceneExplorerManager.GetActiveExplorer()
	if sceneExplorer != undefined do
	(
		for i = 0 to layermanager.count - 1 where (layer = layerManager.getLayer i).current == true do
		(
			layer.select true
			sceneExplorer.ExpandSelected()
		)
	)
)

Linkitch · 2022-12-09

Sadly this doesn't work. Using layer.select true selects all the nodes inside of the layer, not the layer itself.

Linkitch · 2022-12-12

I don't have "Select Children" enabled.

And I sadly cannot get it to do anything other than select all the nodes inside the layer.