MAXScript Language Reference > 3ds Max Objects > Interfaces > Core Interfaces > Core Interfaces Documentation > L >

# Interface: LayerManager

Interfaces > Core Interfaces > LayerManager

| Core Interfaces - Quick Navigation

This Core Interface exposes the Layer Manager to MAXScript.

Properties:

    LayerManager.count : integer : Read

Get the number of layers in the scene

    LayerManager.current : Interface : Read

Returns a LayerProperties MixinInterface to the current layer.

Methods:

    <Interface>LayerManager.getLayer <integer>which

Returns a LayerProperties MixinInterface to the indexed layer.

The index is 0-based.

    <Interface>LayerManager.newLayer()

Creates a new Layer and returns a LayerProperties MixinInterface to it.

    <Interface>LayerManager.getLayerFromName <string>name

Returns a LayerProperties MixinInterface to the layer with the given name.

    <Interface>LayerManager.newLayerFromName <string>name

Creates a new layer with the given name and returns a LayerProperties MixinInterface to it.

    <void>LayerManager.editLayerByName <string>name

Enters editing mode for the layer with the given name.

    <boolean>LayerManager.deleteLayerByName <string>name

Deletes the layer with the given name.

Returns true if layer deleted, false otherwise.

A layer can only be deleted if no nodes are in the layer and the layer is not the currently active layer.

    <void>LayerManager.closeDialog()

Closes the Layer Manager dialog.

    <boolean>LayerManager.isDialogOpen()

Returns true if the Layer Manager dialog is open, false otherwise.

    <ReferenceTarget>LayerManager.getLayerObject {<integer layer_index>|<string layer_name>}

Returns the specified layer as a ReferenceTarget.

layer_index is 0-based, layer_name is case-insensitive.

Available in 3ds Max 2008 and higher. Previously available in the Avguard Extensions.

Note

Deprecated.

Use the LayerProperties interface's .layerAsRefTarg property instead.

Provided for backwards compatibility with scripts written using the Avguard Extension in previous versions of 3ds Max.

EXAMPLE
    for i = 0 to layerManager.count-1 do
    (
      ilayer = layerManager.getLayer i
      layerName = ilayer.name
      layer = ILayerManager.getLayerObject i
      layerNodes = refs.dependents layer
      format "Layer: %; nodes: %\n" layerName layerNodes
    )

## LayerManager Interfaces:

Interface: LayerProperties

Interface: LayerProperties

#### See Also

- Interface: INodeLayerProperties

- Interface: LayerProperties