Message 1 of 16
Not applicable
01-12-2018
12:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying to write a VBA maacro, which when launched in an assembly will go through the BOM and modify the part number of each component.
Some components have "." in the part number, I need to remove "." and everything after it.
I can't figure out where the "part number" property resides
Public Sub CleanWireBOM()
Dim asmDoc As AssemblyDocument
Set asmDoc = ThisApplication.ActiveDocument
Dim oBOM As BOM
Set oBOM = asmDoc.ComponentDefinition.BOM
oBOM.StructuredViewFirstLevelOnly = False
oBOM.StructuredViewEnabled = True
Dim oStructuredBOMView As BOMView
Set oStructuredBOMView = oBOM.BOMViews.Item("Structured")
Dim oBOMRow As BOMRow
For Each oBOMRow In oStructuredBOMView.BOMRows
Dim oCompDef As ComponentDefinition
Dim PartNum As String
PartNum = ?????
Next
End Sub
Solved! Go to Solution.

