Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

@andrew.tom.reynolds,

 

Hoping that below iLogic code may help to update iProperties of "Parts Only" BOMView.

Sub Main()
    Dim oDoc As AssemblyDocument
    oDoc = ThisApplication.ActiveDocument
    
    Dim oDef As AssemblyComponentDefinition
    oDef = oDoc.ComponentDefinition
    
    Dim oBOMView As BOMView
    oBOMView = oDef.BOM.BOMViews.Item("Parts Only")
    
    Dim oBOMRow As BOMRow
    For Each oBOMRow In oBOMView.BOMRows
        Dim oReferDoc As Document
        oReferDoc = oBOMRow.ComponentDefinitions.Item(1).Document
        
        If oReferDoc.DocumentType = kPartDocumentObject Then
            Dim occ As ComponentOccurrence
            For Each occ In oDef.Occurrences
                If occ.ReferencedDocumentDescriptor.ReferencedDocument Is oReferDoc Then
                    If occ.Suppressed = False Then
                        iProperties.Value(occ.Name, "Project", "Part Number") = "XYZ"						
                    End If
                End If
            Next
        End If 
    Next 
End Sub

For further investigation, please provide sample assembly file to test. Also, make sure that files are non confidential.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network