Hello,
I'm trying to write a macro for Inventor to change the material and clear the material override.
I'm beginning with a part and will be extended to assembly (ies)
I've put the material(name) I want in a Label.
Is it the way to go?
Thanks for any help
Code:
Public Sub ClearMaterial()
Dim invDoc As Document
Set invDoc = ThisApplication.ActiveDocument
If invDoc.DocumentType = kPartDocumentObject Then
Dim pcd As PartComponentDefinition
Set pcd = invDoc.ComponentDefinition
Dim mat As material
Set mat.Name = Label1.Caption
pcd.material = mat
End If
End Sub