09-24-2020
11:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
09-24-2020
11:10 AM
Hi @Anonymous
Assuming that the main partslist is the first partslist of the first sheet in the document, and the itemnumber is the first cell of each row in your partslist style, this should at least make it look right. I couldn't find a way to change the start index of the partslists for the individual parts, but you can override the value with a static value.
There are a lot of loops in this code but at least it worked when I tried it ![]()
Dim oDrawing As DrawingDocument = ThisDoc.Document Dim oMainPartsList As PartsList = oDrawing.Sheets(1).PartsLists(1) For Each oRow As PartsListRow In oMainPartsList.PartsListRows For Each oBOMrow As DrawingBOMRow In oRow.ReferencedRows For Each oDef As ComponentDefinition In oBOMrow.BOMRow.ComponentDefinitions For Each oSheet As Sheet In oDrawing.Sheets For Each oPartsList As PartsList In oSheet.PartsLists If oPartsList IsNot oMainPartsList If oPartsList.ReferencedDocumentDescriptor.ReferencedDocument Is oDef.Document _ Then oPartsList.PartsListRows.Item(1).Item(1).Value = oBOMrow.BOMRow.ItemNumber End If Next oSheet.Update Next Next Next Next
Jhoel Forshav
Download my free Inventor Addin - Hole Projector
LinkedIn | Ideas | Contributions | Blog posts | Website