In the example I gave you, the assembly part or drawing is only to activate the rule, not to use it itself, what you need is to configure the rule, so that it looks in the folder requested all the drawings (I do not know which is the route of the folder that contains drawings)
This rule looks only for drawing files, it does not look for assembly files. and will return the properties of those drawings in an excel table.
Dim processPath As String = ThisDoc.Path
and place your path of drawing files, for example
Dim processPath As String = "D:\Inventor\Drawings Files"
'Example
Dim Dirxlsx As String = "E:\Libro1.xlsx" ''' Specify the excel template path
Dim osheet As String = "Sheet1" ''' Specify the excel template sheet
Dim oExcelName As String = "Drawing_List" & ".xlsx" ''' Specify the excel file name to save list
Dim processPath As String = ThisDoc.Path ''' "D:\Inventor\Planos en Inventor" '''Specify the path of the find folder
'Open excel application
xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
xlWorkbook = xlApp.Workbooks.Open(Dirxlsx)
xlWorksheet = xlWorkbook.Worksheets.Item(osheet)
Dim row As Integer
row = 2 ''' Indicate from which row the copying will start to excel
Dim drawings () As String = System.IO.Directory.GetFiles(processPath,"*.idw",System.IO.SearchOption.AllDirectories)
For Each drawing As String In drawings
On Error Resume Next
Dim oDoc As Document = ThisApplication.Documents.Open(drawing, False)
xlWorksheet.Range("A" & row).Value = oDoc.DisplayName
xlWorksheet.Range("B" & row).Value = oDoc.PropertySets.Item("Design Tracking Properties").Item("Part Number").Value
xlWorksheet.Range("C" & row).Value = oDoc.PropertySets.Item("Inventor User Defined Properties").Item("ACME_DRAWING").Value
xlWorksheet.Range("D" & row).Value = oDoc.PropertySets.Item("Inventor User Defined Properties").Item("ACME_DESCRIPTION").Value
oDoc.Close
row=row+1
Next
xlWorksheet.Columns("A:Z").AutoFit
MessageBox.Show(oExcelName , "Export to")
xlWorkBook.SaveAs(processPath & "\" & oExcelName)
xlWorkbook.Close(True)
xlApp.Quit
Excuse me if I have not been clear. regards
Please accept as solution and give likes if applicable.
I am attaching my Upwork profile for specific queries.
Sergio Daniel Suarez
Mechanical Designer
| Upwork Profile | LinkedIn