Anonymous
in reply to:
Anonymous
06-22-2016
06:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
06-22-2016
06:51 AM
Hi,
Some Error comes in the Red line Method 'Material' of object 'PartComponentDefinition' failed
Private Sub CommandButton2_Click()
Dim oApp As Inventor.Application
Set oApp = ThisApplication
Dim oDoc As AssemblyDocument
Set oDoc = ThisApplication.ActiveDocument
Dim strMaterialName As String
strMaterialName = "1.4307"
Dim oOcc As ComponentOccurrence
For Each oOcc In oDoc.ComponentDefinition.Occurrences.AllLeafOccurrences
oOcc.Definition.Material = oDoc.Materials.Item(strMaterialName)
Next
End Sub