AddLayer

Adds a new layer to the document.

Syntax

rhinoscriptsyntax.AddLayer (name=None, color=0, visible=True, locked=False, parent=None)

rhinoscript.layer.AddLayer (name=None, color=0, visible=True, locked=False, parent=None)

Parameters

name

Optional.  String.  The name of the new layer.  If omitted, Rhino automatically generates the layer name.

color

Optional.  Number or System.Drawing.Color.  A Red-Green-Blue color value.  If omitted, the color Black is assigned.

visible

Optional.  Boolean.  The layer's visibility. The default is visible (True).

locked

Optional.  Boolean.  The layer's locked state. The default is not locked (False).

parent

Optional.  String or Guid.  The new layer's parent layer. If omitted, the new layer will have not parent layer.

Returns

String

The name of the new layer if successful.

Example

import rhinoscriptsyntax as rs

from System.Drawing import Color

print "New layer:", rs.AddLayer()

print "New layer:", rs.AddLayer("MyLayer1")

print "New layer:", rs.AddLayer("MyLayer2", Color.DarkSeaGreen)

print "New layer:", rs.AddLayer("MyLayer3", Color.Cornsilk)

print "New layer:", rs.AddLayer("MyLayer4",parent="MyLayer3")

Also See

CurrentLayer

DeleteLayer

RenameLayer