This will depend on the behavior you want. Say there are 2 occurrences of a
sub-assembly in the top level assembly. Do you then want to set the part
occurrence color individually for each occurrence within those occurrences?
If so, you need to set the color on a ComponentOccurrenceProxy as shown in
the code below. If you want the color to apply to all instances of the
sub-assembly, you need to jump over to the sub-assembly document and apply
the color there.
Sanjay-
Dim oDoc As AssemblyDocument
Set oDoc = invApp.ActiveDocument
Dim oAsmCompDef As AssemblyComponentDefinition
Set oAsmCompDef = invApp.ActiveDocument.ComponentDefinition
' Get references to the two occurrences to constrain.
Dim oOcc1 As ComponentOccurrence
Set oOcc1 = oAsmCompDef.Occurrences.ItemByName("Assembly1:1")
Dim oOccProxy1 As ComponentOccurrenceProxy
Set oOccProxy1 = oOcc1.SubOccurrences.Item(1)
Dim oRenderStyle As RenderStyle
Set oRenderStyle = oDoc.RenderStyles.Item(sColor)
oOccProxy1.SetRenderStyle kOverrideRenderStyle, oRenderStyle