Message 1 of 4
custom item numbers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I am looking to make a program that will re-number all of the Item Numbers for an assembly BOM. (I use Structured BOM's) Below is what I have come up with so far. Basically i want the last four numbers in the part number to be the new item number and for any parts that are "PURCHASED PARTS" I want a sequential numbering scheme. (an example of this is bellow) Ultimately I need help with the If statement and the sequential numbering. I have done a ton of googling and searching this forum and tried many things i thought might work but have gotten no where. any help will be appreciated.
thanks you,
Dim oDrawing As DrawingDocument = ThisDrawing.Document
Dim oCount As Array = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
For Each oSheet As Sheet In oDrawing.Sheets
For Each oPartsList As PartsList In oSheet.PartsLists
For Each oRow As PartsListRow In oPartsList.PartsListRows
For Each oBOMRows As DrawingBOMRow In oRow.ReferencedRows
'oCell = oPartsList.PartsListRows.Item(I).Item("Material")
'If oCell.Value = "PURCHASED PART" Then
i = "SA-" & oCount
oBOMRows.BOMRow.ItemNumber = i
'Else If oCell.Value <> "PURCHASED PART"
'Dim oPnum As String = oBOMRows.BOMRow.ComponentDefinitions(1).Document.PropertySets.Item("Design Tracking Properties") _
'.Item("Part Number").Value
'oBOMRows.BOMRow.ItemNumber = oPnum.Substring(oPnum.Length - 4)
'End If
Next
Next
Next
Next