Copies the material definition from one material to one or more objects.
Rhino.MatchMaterial (intSrcMaterialIndex, strDestObject)
Rhino.MatchMaterial (strSrcObject, arrDestObjects)
intSrcMaterialIndex |
Required. Number. The zero-based source material index. |
strSrcObject |
Required. String. The identifier of the source object. The object must have a material assigned. |
strDestObject |
Required. String. The identifier of the destination object. If the object's material source is set to "By Layer", it will be changed to "By Object." |
arrDestObjects |
Required. Array. An array of destination object identifiers. If the objects' material sources are set to "By Layer", they will be changed to "By Object." |
Number |
The number of object that were modified if successful. |
Null |
It not successful, or on error. |
Dim strObject, arrObjects
strObject = Rhino.GetObject("Select source object")
If Not IsNull(strObject) And (Rhino.ObjectMaterialIndex(strObject) > -1) Then
arrObjects = Rhino.GetObjects("Select destination objects")
If IsArray(arrObjects) Then
Rhino.MatchMaterial strObject, arrObjects
End If
End If