ParentLayer

Returns or modifies the parent layer of a layer.

Syntax

rhinoscript.layer.ParentLayer (layer, parent=None)

rhinoscriptsyntax.ParentLayer (layer, parent=None)

Parameters

layer

Required.  String.  The name of the layer.

parent

Optional.  String.  The name of the new parent layer. To remove the parent layer, thus making a root-level layer, specify an empty string "".

Returns

String

If parent is not specified, the name of the current parent layer if successful.

String

If parent is specified, the name of the previous parent layer if successful.

None

If the layer does not have a parent.

Example

import rhinoscriptsyntax as rs

layers = rs.LayerNames()

for layer in layers:

    parent = rs.ParentLayer(layer)

    print "Layer:", layer, ", Parent:", parent

Also See

LayerChildren