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: 

iLogic BOM Structure Check from assembly drawing

1 REPLY 1
Reply
Message 1 of 2
SoulAsasin
354 Views, 1 Reply

iLogic BOM Structure Check from assembly drawing

Hello all

 

Is it possible to go trough the part list in a drawing and check the BOM structure of every component in it?

 

I manage to go trough the part list, but i Don't know how to get the component of a specific row, to check it's Bom structure.

 

Anybody any info on this ?

 

Thank you.

Inventor 2012
Win 7 64-bit
Dell Precision T5400
Intel Xeon 2,5 GHz
8 Gb RAM
NVIDIA Quadro Fx 3700
1 REPLY 1
Message 2 of 2
dkatz
in reply to: SoulAsasin

I think this might help you get there a little:

 

http://reinventinginventor.wordpress.com/2014/11/19/exporting-parts-lists-from-drawings-to-excel-wit...

 

Specifically, this part of the code grabs the referenced document for each row (I deleted the nonrelevant parts). FYI, You have to have a partslist selected before you run the program.

 

Dim drawDoc As Document
    Set drawDoc = ThisApplication.ActiveDocument
    If Not (TypeOf drawDoc Is DrawingDocument) Then
        MsgBox “A drawing must be active.”
        GoTo retry
    End If
    ‘ Make sure a parts list is selected.
    Dim partList As Object
    Set partList = drawDoc.SelectSet.Item(1)
    If Not (TypeOf partList Is PartsList) Then
        MsgBox “A parts list must be selected.”
        GoTo retry
    End If
    
    
    Dim drawBomRow As DrawingBOMRow
   
   
    For Each partListRow In partList.PartsListRows
        
        ‘ Get the thumbnail from the document associated with the current row.
        Set drawBomRow = partListRow.ReferencedRows.Item(1)
        Dim refDoc As Document
        Set refDoc = drawBomRow.BOMRow.ComponentDefinitions.Item(1).Document
        'Do whatever you're going to do with the component here.
    Next

 

I think this should work with iLogic.

 

Hope that helps,

Dave

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report