MaterialIndex

Returns the index of a material given the material's identifier.

Syntax

Rhino.MaterialIndex (strMaterial)

Parameters

strMaterial

Required.  String.  The identifier of an existing material.

Returns

Number

The material's index if successful.

Null

If not successful, or on error.

Example

Dim arrMaterials, strMaterial

arrMaterials = Rhino.MaterialIds

If IsArray(arrMaterials) Then

  For Each strMaterial In arrMaterials

    Rhino.Print Rhino.MaterialIndex(strMaterial)

  Next

End If

Also See

MaterialId

MaterialIds

MaterialIndices