Returns 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)
|
strLayer |
Required. String. The name of an existing layer. |
|
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