LayerMaterialIndex

Returns or changes the material index of a layer.  A material index of -1 indicates that no material has been assigned to the layer.  Thus, the layer will use Rhino's default layer material.

Syntax

Rhino.LayerMaterialIndex (strLayer [, intIndex])

Parameters

strLayer

Required.  String.  The name or identifier of an existing layer.

intIndex

Optional.  Number.  The new material index.

Returns

Number

 A zero-based material index if successful.

Null

If not successful, or on error.

Example

Dim intIndex

intIndex = Rhino.LayerMaterialIndex("Default")

If IsNumeric(intIndex) Then

If intIndex = -1 Then

Rhino.Print "The default layer does not have a material assigned."

Else

Rhino.Print "The default layer has a material assigned."

End If

End If

Also See