BOM value from PartsList column

Anonymous

BOM value from PartsList column

Anonymous
Not applicable

Hi everyone!

 

I am new to Inventor. I am working on assembly drawings and parts list. I understand that BOM is not the same entity as PartsList. I made parts list with some additional column that do not exist in BOM. I want to reference values from that column in BOM balloon. Is it possible to do this?

Note: For DET column, I made VBA procedure that takes ITEM column value for purchased components and assigns it on DET column value except for manufactured components which get values from manufactured detail number.

 

0 Likes
Reply
Accepted solutions (2)
4,099 Views
22 Replies
Replies (22)

Anonymous
Not applicable
Accepted solution

Quote: "Just use a macro to change the item number to a 4 digit format"

 

I did not know that Item in Parts list in not hard-coded. This means that I can change value of Item column!!!

 

So I did just that in my macro, set Item & Qty for BOM ballon, and ... It works!!!

 

Thank you all for your help.

 

For reference, placing custom column's name from PartsList on "user property" for BOM balloon display setting does not work.

 

Here is the macro:

Public Sub ChangeItemColumValue()

' Set a reference to the drawing document.
' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument
Set oDrawDoc = ThisApplication.ActiveDocument
  
' Set a reference to the first parts list on the active sheet.
' This assumes that a parts list is on the active sheet.
Dim oPartList As PartsList
Set oPartList = oDrawDoc.ActiveSheet.PartsLists.Item(1)
 
Dim oVendor As PartsListCell
Dim oPartNumber As PartsListCell
Dim oDetail As PartsListCell
Dim oItem As PartsListCell

Dim invPartNumber As String
Dim invCharPosition As Integer

' Iterate through the contents of the parts list.
Dim i As Long
For i = 1 To oPartList.PartsListRows.Count
    'Get value from PartNumber column
    Set oPartNumber = oPartList.PartsListRows.Item(i).Item("NUMBER")
    Set oItem = oPartList.PartsListRows.Item(i).Item("ITEM")
    Set oVendor = oPartList.PartsListRows.Item(i).Item("SUPPLIER")

    'find a specific part number
    If oVendor.Value = "AAA" Then
        invCharPosition = InStr(1, oPartNumber.Value, "-D")
        invPartNumber = Mid(oPartNumber.Value, invCharPosition + 1, 4)
        'write to the target cell
        'oDetail.Value = invPartNumber
        oItem.Value = invPartNumber
    Else
        Select Case CInt(oItem.Value)
            Case Is < 10
                oItem.Value = "000" & oItem.Value
            Case Is < 100
                oItem.Value = "00" & oItem.Value
            Case Is < 1000
                oItem.Value = "0" & oItem.Value
            Case Else

            End Select
    End If
Next

End Sub

 

johnsonshiue
Community Manager
Community Manager
Accepted solution

Hi! The behaviors shown in the images look different than what I saw on my machine. Could you share the files with me (johnson.shiue@autodesk.com)? I would like to understand it better.

Many thanks!

 



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes

Anonymous
Not applicable

Johnson,

 

I will send you files on Monday, when I get back to work.

 

Thank you.

0 Likes