Hi @dhanshri_gavas . To get the color of the part, you need to use the ActiveAppearance method. This method will give you the active Asset. An example of getting an Asset in assemblies and details is below:
Public Sub Main()
Dim oDoc As Document = ThisDoc.Document
If oDoc.DocumentType = DocumentTypeEnum.kAssemblyDocumentObject Then
Dim oADoc As AssemblyDocument = oDoc
Dim oOccs As ComponentOccurrences = oADoc.ComponentDefinition.Occurrences
For Each oRefDoc As PartDocument In oADoc.AllReferencedDocuments.OfType(Of PartDocument)
If oOccs.AllLeafOccurrences(oRefDoc.ComponentDefinition).Count = 0 Then Continue For
Call GetColorDoc(oRefDoc)
Next
Else If oDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
Dim oPDoc As PartDocument = oDoc
Call GetColorDoc(oPDoc)
End If
End Sub
Private Function GetColorDoc(ByVal oPDoc As PartDocument)
Dim oAsset As Asset = oPDoc.ActiveAppearance
Logger.Info("Part - " & oPDoc.DisplayName)
Logger.Info("Color - " & oAsset.DisplayName & vbLf)
End Function
This code gets the Asset in line 17 and then shows the color information in the iLogic Log.