Hello
Maybe I'm completely missing it in the API reference, but is there no way to access the document referenced in a parts list row, from the `PartsListRow` object?
Thanks
Hi @meGVGMF. It does seem a bit more complicated than you would think it would be, but you basically have to climb the PartsListRow.ReferencedRows ladder. It represents an ObjectsEnumerator filled with DrawingBomRow objects, so you will need to create that specific type of variable to set the object to, then the BOMRow property, which gets you the BOMRow object you may be familiar with. Then CompnentDefinitions... and so on.
Edit: Below is a quickie example of that path:
Dim oPListRow As PartsListRow
Dim oDBOMRow As DrawingBOMRow = oPListRow.ReferencedRows.Item(1)
Dim oRowDoc As Document = oDBOMRow.BOMRow.ComponentDefinitions.Item(1).Document
Wesley Crihfield
(Not an Autodesk Employee)
And, maybe I don't understand, but if it's a list, which `DrawingBomRow` object do I take?
I don't fully understand how one PartsListRow can represent multiple DrawingBOMRows, but I just assumed it was similar to how one BOMRow can represent multiple ComponentDefinitions. I know that BOMRows can be 'merged' or 'rolled up' so I assume the same can be done at the DrawingBOM level, but I have never had the need to explore into that aspect before. I just always work with the 'first' one.
Edit: It could be from...if in your assembly's BOM, you have it set to 'all levels' instead of 'top level only', so that each component that represents an assembly will have one main row, and also some sub-rows. Then that perpetuates into the DrawingBOM, but not into the PartsList. So maybe the one row in the PartsList that represents a sub-assembly, may be showing as one row in the PartsList, but it may have multiple rows at the DrawingBOM level, due to the 'all levels' structure. I'm not sure. I never use the 'all levels' setting in my work.
Wesley Crihfield
(Not an Autodesk Employee)
Ok that makes sense to me. So I can rely on the first index being always the nominal parts list row, and the `PartsListRow` object?
Can't find what you're looking for? Ask the community or share your knowledge.