Can anybody help?
Can somebody check the following VBA macro and tell me what is wrong with it?
Public Function SetPartChrome()
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument
Dim localAsset As Asset
On Error Resume Next
Set localAsset = oDoc.Assets.Item("Chrome - Polished")
If Err Then
On Error GoTo 0
Dim assetLib As AssetLibrary
Set assetLib = ThisApplication.AssetLibraries.Item("Autodesk Appearance Library")
Dim libAsset As Asset
Set libAsset = assetLib.AppearanceAssets.Item("Chrome - Polished")
Set localAsset = libAsset.CopyTo(oDoc)
End If
oDoc.ActiveAppearance = localAsset
End Function
I have an existing part (ipt) and all I am trying to do is to run the macro to set the part finish to chrome
Many thanks in advance!
Darren