DeleteLayer

Removes an existing layer from the document.  The layer to be removed cannot be the current layer.  Unlike the PurgeLayer method,  the layer must be empty, or contain no objects, before it can be removed. Any layers that are children of the specified layer will also be removed if they are also empty.

Syntax

rhinoscriptsyntax.DeleteLayer ( layer )

rhinoscript.layer.DeleteLayer ( layer )

Parameters

layer

Required.  String or Guid.  The name or Id of an empty layer.

Returns

Boolean

True or false indicating success or failure.

Example

import rhinoscriptsyntax as rs

layer = rs.GetString("Layer to remove")

if layer: rs.DeleteLayer(layer)

Also See

AddLayer

CurrentLayer

PurgeLayer

RenameLayer