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.
rhinoscriptsyntax.LayerMaterialIndex (layer, index=None)
rhinoscript.layer.LayerMaterialIndex (layer, index=None)
layer |
Required. String. The name of an existing layer. |
index |
Optional. Integer. The new material index |
Number |
A zero-based material index if successful. |
import rhinoscriptsyntax as rs
index = rs.LayerMaterialIndex("Default")
if index is not None:
if index==-1:
print "The default layer does not have a material assigned."
else:
print "The default layer has a material assigned."