ParentLayer

Returns or modifies the parent layer of a layer.

Syntax

Rhino.ParentLayer (strLayer [, strParent])

Parameters

strLayer

Required.  String.  The name or identifier of the layer.

strParent

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

Returns

String

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

String

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

Null

If the layer does not have a parent, or on error.

Example

Dim arrLayers, strLayer, strParent

arrLayers = Rhino.LayerNames

For Each strLayer In arrLayers

  strParent = Rhino.ParentLayer(strLayer)

  If IsNull(strParent) Then

    Rhino.Print "Layer: " & strLayer & ", Parent: <none>"

  Else

    Rhino.Print "Layer: " & strLayer & ", Parent: " & strParent

  End If

Next

Also See

LayerChildren