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.
Rhino.LayerMaterialIndex (strLayer [, intIndex])
strLayer |
Required. String. The name or identifier of an existing layer. |
intIndex |
Optional. Number. The new material index. |
Number |
A zero-based material index if successful. |
Null |
If not successful, or on error. |
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