Returns or modifies a material's user-definable name.
Rhino.MaterialName (intMaterialIndex [, strName])
intMaterialIndex |
Required. Number. The zero-based source material index. |
strName |
Optional. String. The new name. If omitted, the current name is returned. |
String |
If strName is not specified, the current material name if successful. |
String |
If strName is specified, the previous material name if successful. |
Null |
It not successful, or on error. |
Dim strObject, intIndex
strObject = Rhino.GetObject("Select object")
If Not IsNull(strObject) Then
intIndex = Rhino.ObjectMaterialIndex(strObject)
If (intIndex > -1) Then
Rhino.MaterialName intIndex, "Fancy_Material"
End If
End If