/ HALion Developer Resource / HALion Script / Reference /

removeLayer

removeLayer(layerOrPosition)

Description

Function to remove a layer from the specified layer. For example, this.parent specifies the parent layer of the script module as the layer that contains the layer to be removed. The layer is determined by its Layer object or its position. You can use getLayer or findLayers to determine the Layer object. The position is the number indexing the layers within the specified layer.

Available in: Controller.

Arguments

ArgumentDescriptionValue Type
layerOrPositionThe Layer object or the position of the layer to be removed.Layer or number

Example

-- Remove all layers from the program.

layers = this.program:findLayers(true)

for i, layer in ipairs(layers) do
    layer.parent:removeLayer(layer)
end

See also: removeBus, removeEffect, removeMidiModule, removeZone, Layer