Hi Marcelo,
I do not have an example that does this but I believe your code would need to traverse through the components of the assembly and call UpdateFromGlobal for the styles and materials. This post has C# examples.
http://modthemachine.typepad.com/my_weblog/2012/10/c-help-examples-for-assemblies-occurences.html
The example function in that project named AssemblyCount tranverses an assembly. (does not call UpdateFromGlobal however).
Here is a VBA procedure that can be used for a quick test for UpdateFromGlobal with a sheet metal PartDocument.
Sub SheetMetal_Sytle_Update_Test()
Dim oPartDoc As PartDocument
Set oPartDoc = ThisApplication.ActiveDocument
Dim oSheetMetalCompDef As SheetMetalComponentDefinition
Set oSheetMetalCompDef = oPartDoc.ComponentDefinition
Dim oSheetMetalStyle As SheetMetalStyle
Set oSheetMetalStyle = oSheetMetalCompDef.ActiveSheetMetalStyle
oSheetMetalStyle.UpdateFromGlobal
End Sub
Here is a VBA example that calls UpdateFromGlobal for materials in a PartDocument.
Sub Material_Update_Test()
Dim oPartDoc As PartDocument
Set oPartDoc = ThisApplication.ActiveDocument
Dim mat As Material
For Each mat In oPartDoc.Materials
If mat.UpToDate = False Then
Call mat.UpdateFromGlobal
'Debug.Print mat.Name
End If
Next
End Sub
This post has information about appearance assets that may help with what you are trying to do:
http://forums.autodesk.com/t5/inventor-customization/updatefrom-global-for-colors-appearances/m-p/64...
Thanks,
Wayne
Wayne Brill
Developer Technical Services
Autodesk Developer Network