Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I have 10 No. of iam files in a folder. I want to iterate bom structure enabled in all assemblies. I have written some code which need to be corrected. Can anybody help?
Regards,
Karth
Sub IterateBomEnable()
Dim oPath As String
oPath = "C:\Users\KTest\"
Dim oFileName As String
oFileName = Dir(oPath & "*.iam")
Do While oFileName <> ""
Debug.Print "Processing " & oPath & oFileName
oFileName = Dir
Loop
For Each oFileName In ???
Dim oAsmDoc As AssemblyDocument
Set oAsmDoc = ThisApplication.Documents.Open("oFileName")
Dim oBom As BOM
Set oBom = oAsmDoc.ComponentDefinition.BOM
oBom.StructuredViewEnabled = True
oBom.PartsOnlyViewEnabled = True
Next
End Sub
Solved! Go to Solution.