Try this one
'Public Sub RemovePartOverrides()
Sub Main()
If TypeOf ThisApplication.ActiveDocument Is PartDocument Then
' Get the active part document.
Dim partDoc As PartDocument
partDoc = ThisApplication.ActiveDocument
' Iterate through the objects that have an override.
Dim obj As Object
For Each obj In partDoc.ComponentDefinition.AppearanceOverridesObjects
' Legt die Quelle des Erscheinungsbildes auf der Grundlage des Objekttyps fest.
' Es ist möglich, kPartAppearance in allen Fällen zu verwenden, aber dies setzt
' auf die Standardquelle, die von Inventor verwendet wird, wenn keine Überschreibungen existieren.
If TypeOf obj Is SurfaceBody Then
obj.AppearanceSourceType = kPartAppearance
ElseIf TypeOf obj Is PartFeature Then
obj.AppearanceSourceType = kBodyAppearance
ElseIf TypeOf obj Is Face Then
obj.AppearanceSourceType = kFeatureAppearance
Else
MsgBox ("Unerwarteter Typ mit überschriebenem Aussehen:")
End If
Next
' Dim partDoc As PartDocument
' partDoc = ThisApplication.ActiveDocument
Dim oPartDef As PartComponentDefinition
oPartDef = partDoc.ComponentDefinition
' Ruft eine Referenz auf den Material-Renderstil ab.
Dim oRenderStyle As RenderStyle
oRenderStyle = oPartDef.Material.RenderStyle
' Weisen Sie dem Bauteil den Renderstil zu.
partDoc.ActiveRenderStyle = oRenderStyle
' Erzwingt die Aktualisierung der Ansicht, um die Änderung zu sehen.
ThisApplication.ActiveView.Update
End If
If TypeOf ThisApplication.ActiveDocument Is AssemblyDocument Then
' Abrufen des aktiven Baugruppendokuments.
Dim oAssDoc As AssemblyDocument = ThisDoc.Document
Dim oCompDef As AssemblyComponentDefinition=oAssDoc.ComponentDefinition
Dim oOcc As ComponentOccurrence
For Each oOcc In oCompDef.Occurrences
If oOcc.Suppressed = False Then
' oOcc.UnSuppress
' Stellt Sie es so ein, dass das Auftreten die Originalfarbe des Teils verwendet.
oOcc.AppearanceSourceType = kPartAppearance
End If
Next
End If
End Sub