08-31-2018
02:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-31-2018
02:14 AM
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
