@blandb
Thanks for providing the files, I have found two things one is that in your project settings it is not able to find Library path (the solution is to comment that line in code as it is not required).
The second and most important thing is, the names that you are adding as multi-value in "PAINT" parameter must exactly match with appearance name, I have observed that you have written "JET BLACK" only, whereas your appearance name is "JET BLACK P/N 17108P", please change your multivalue with exact names, Try below code where I have removed the library path line and, make sure you change your multi-value text same as appearance names.
As an example, a multivalue setlist should look like this
MultiValue.SetList("PAINT","STATUARY BRONZE P/N 17106P", "JET BLACK P/N 17108P")
Updated rule,
Dim oDoc As AssemblyDocument = ThisApplication.ActiveDocument
Dim oDef As AssemblyComponentDefinition = oDoc.ComponentDefinition
Dim oOcc As ComponentOccurrence
Dim oProjectMgr As DesignProjectManager = ThisApplication.DesignProjectManager
Dim CCPath As String = oProjectMgr.ActiveDesignProject.ContentCenterPath
Dim assetLib As AssetLibrary = ThisApplication.AssetLibraries.Item("KANE Material Library") 'Set which library you want to get your color from
Dim oApperance As Asset = assetLib.AppearanceAssets.Item(Parameter("PAINT"))
For Each oOcc In oDef.Occurrences
If oOcc.DefinitionDocumentType = DocumentTypeEnum.kPartDocumentObject 'And oOcc.Definition.Document.FullFileName.Contains(CCPath) = False Then
Dim oPdef As PartDocument = oOcc.Definition.Document
oPdef.ActiveAppearance = oApperance
End If
Next
Another bonus tip here, if you don't want to type in all the names exactly as they are in appearance in your "PAINT" multi-value parameter, try the below code, it actually captures all the appearance names in the active library and add them to the "PAINT" parameter multi-value list. Add it in a separate rule and you will see that all your appearance names will be added to the PAINT multi-value parameter list.
Dim assetLib As AssetLibrary = ThisApplication.ActiveMaterialLibrary
Dim Appearances As AssetsEnumerator = assetLib.AppearanceAssets
Dim oList As New ArrayList
For Each oAP As Asset In Appearances
oList.Add(oAP.DisplayName)
Next
MultiValue.List("PAINT")=oList
Hope this is helpful.
If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!
Regards,
Dutt Thakar
LinkedIn