Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VBA Macro - Set Part Chrome Not Working

1 REPLY 1
Reply
Message 1 of 2
isocam
127 Views, 1 Reply

VBA Macro - Set Part Chrome Not Working

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

1 REPLY 1
Message 2 of 2
Frederick_Law
in reply to: isocam

The part might have overridden Appearance.

There are material, body and face Appearance.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report