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.
rhinoscriptsyntax.DeleteLayer ( layer )
rhinoscript.layer.DeleteLayer ( layer )
layer |
Required. String or Guid. The name or Id of an empty layer. |
Boolean |
True or false indicating success or failure. |
import rhinoscriptsyntax as rs
layer = rs.GetString("Layer to remove")
if layer: rs.DeleteLayer(layer)
AddLayer