- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I’m struggling with the parts list.
The goal is: Merging 2 different parts together, and reset the amount of pcs into a set.
So,
I have 2 different parts (A.ipt and B.ipt) with the same properties. ( same part nr, description..)
The 2 parts are physically the same, but in 3D we have a stand alone and a build-in version.
When I generate a drawing with parts list (BOM), then I want to have these 2 parts merged together.
The amount of these 2 parts must be counted together, and then divided into a SET. (1 set = 8 pcs)
I have the code to set the new quantity into a set of 8.
See below:
'part A Case InStr(oBOMView.BOMRows.Item(j).ReferencedFileDescriptor.ReferencedFile.FullFileName, "part A") sNewQty = RoundUp(oBOMView.BOMRows.Item(j).TotalQuantity / 8) oBOMView.BOMRows.Item(j).TotalQuantity = sNewQty
But now I want to add the code that merge the 2 .ipt files into 1 amount.
The tricky part is that we can have 3 different assemblies:
- Only parts A.ipt
- Only parts B.ipt
- Parts A.ipt and B.ipt ( in this case I want to merge A and B together)
Maybe something like this:
If sQtypartA > sQtypartB Then sNewQty = sQtypartA Else sNewQty = sQtypartB End If If sBOMRowpartA <> 0 And sBOMRowpartB <> 0 Then Set oBOMRow = oBOMView.BOMRows.Item(sBOMRowpartA) oBOMRow.TotalQuantity = 0 Set oBOMRow = oBOMView.BOMRows.Item(sBOMRowpartB) oBOMRow.TotalQuantity = sNewQty End If If sBOMRopartA = 0 And sBOMRowpartB <> 0 Then Set oBOMRow = oBOMView.BOMRows.Item(sBOMRowpartB) oBOMRow.TotalQuantity = sNewQty End If If sBOMRowpartA <> 0 And sBOMRowpartB = 0 Then Set oBOMRow = oBOMView.BOMRows.Item(sBOMRowpartA) oBOMRow.TotalQuantity = sNewQty End If
Can someone please help me out with the code?
Thanks!
Best regards,
Maarten
Solved! Go to Solution.