Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting part document reference from parts list row

4 REPLIES 4
Reply
Message 1 of 5
meGVGMF
279 Views, 4 Replies

Getting part document reference from parts list row

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

Tags (3)
Labels (3)
4 REPLIES 4
Message 2 of 5
WCrihfield
in reply to: meGVGMF

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

EESignature

(Not an Autodesk Employee)

Message 3 of 5
meGVGMF
in reply to: WCrihfield

And, maybe I don't understand, but if it's a list, which `DrawingBomRow` object do I take?

Message 4 of 5
WCrihfield
in reply to: meGVGMF

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

EESignature

(Not an Autodesk Employee)

Message 5 of 5
meGVGMF
in reply to: WCrihfield

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.

Post to forums  

Autodesk Design & Make Report