Hello,
Expanding on the posted code from earlier, I would like to add a part number to part list titles as well.
In my particular case, I need to create IDWs that are as condensed as possible. To accomplish this, I sometimes need to show multiple configurations of iassemblies/iparts on one sheet. I agree it's less than ideal, but I don't make the rules 😄
So, I have re-worked the above code to iterate through each sheet and add a part number to each part list. I have two problems though:
-> using a for loop to step through each parts list in a sheet doesn't seem to work due to sheets not being containers(?).
-> I have verified that i'm accessing different parts lists, but I'm getting the same part number on all titles of all iparts and iassemblies. I think this is because iassemblies don't have individual iprops? or maybe this has something to do with the way part lists reference parts?
Help appreciated.

Sub Main()
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet
For Each oSheet In oDrawDoc.Sheets
Dim oPartList1 As PartsList
Dim oPartList2 As PartsList
Dim oPartList3 As PartsList
Try
oPartList1 = oSheet.PartsLists.Item(1)
oRef = oPartList1.ReferencedDocumentDescriptor.ReferencedDocument
oPartNo = oRef.PropertySets.Item("Design Tracking Properties").Item("Description").Value
oPartList1.Title = "PARTS LIST - " & oPartNo
Catch
End Try
Try
oPartList2 = oSheet.PartsLists.Item(2)
oRef = oPartList2.ReferencedDocumentDescriptor.ReferencedDocument
oPartNo = oRef.PropertySets.Item("Design Tracking Properties").Item("Description").Value
oPartList2.Title = "PARTS LIST - " & oPartNo
Catch
End Try
Try
oPartList3 = oSheet.PartsLists.Item(3)
oRef = oPartList3.ReferencedDocumentDescriptor.ReferencedDocument
oPartNo = oRef.PropertySets.Item("Design Tracking Properties").Item("Description").Value
oPartList3.Title = "PARTS LIST - " & oPartNo
Catch
End Try
Next
End Sub
'Sub SetTitle(oPartList As PartsList)
'
' oRef = oPartList.ReferencedDocumentDescriptor.ReferencedDocument
' oPartNo = oRef.PropertySets.Item("Design Tracking Properties").Item("Description").Value
' oPartList.Title = "PARTS LIST1 - " & oPartNo
'
'End Sub