- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
There is a problem in this red line.. It simply closes the Inventor without changing any material.
Dim oApp As Inventor.Application
Set oApp = ThisApplication
Dim oDoc As AssemblyDocument
Set oDoc = ThisApplication.ActiveDocument
Dim strMaterialNameToChange As String
strMaterialNameToChange = "Aluminium"
Dim strNewMaterialName As String
strNewMaterialName = "Steel"
Dim oOcc As ComponentOccurrence
For Each oOcc In oDoc.ComponentDefinition.Occurrences.AllLeafOccurrences
If oOcc.Definition.Material.name = strMaterialNameToChange And oOcc.Definition.IsContentMember = False Then
oOcc.Definition.Material = oDoc.Materials.Item(strNewMaterialName)
End If
Next
I don't know the exact issue. but, Do I need to include any object library?
Sukpal