Adds a new layer to the document.
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)
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. |
String |
The name of the new layer if successful. |
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")