This is a bit different solution then you asked for but could work for you. The following rule will add a custom iProperty to each document. With information if the document is a sheet metal part. Then if you add that custom property to your bom view you can sort and export it like normal. And if you want you can filter the parts in excel.

Public Sub Main()
Dim doc As AssemblyDocument = ThisDoc.Document
For Each refDoc As Document In doc.AllReferencedDocuments
If (refDoc.DocumentType <> DocumentTypeEnum.kPartDocumentObject) Then
Continue For
End If
Dim isSheetMetal = (refDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}")
SetCustomProperty(refDoc, "IsSheetMetalPart", isSheetMetal)
Next
End Sub
Public Sub SetCustomProperty(doc As Document, name As String, value As Object)
Dim fileInfo As New IO.FileInfo(doc.FullFileName)
fileInfo.IsReadOnly = False
Dim propSet = doc.PropertySets.Item("Inventor User Defined Properties")
Try
Try
Dim prop = propSet.Item(name)
prop.Value = value
Catch ex As Exception
propSet.Add(value, name)
End Try
Catch ex As Exception
MsgBox("Could not change/update document: " & doc.FullFileName)
End Try
End Sub
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

Blog: hjalte.nl - github.com