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

Export Part Lists from multiple sheets

I stumbled across some iLogic that I am having a hard time manipulating.  I am looking to export Part Lists from multiple sheets ( pipe spools) of an IDW.  I would like the code to export "SPOOL:*" to separate excel files called SPOOL#*. (Where each "*" is a sheet.)  I am unsure create code that loops to the next sheet while writing the correct excel file.  Any help or advice is appreciated.

 

 

Dim oDoc As Inventor.DrawingDocument
oDoc = ThisDoc.Document

Dim oSheet As Inventor.Sheet
'oSheet = oDoc.Sheets(1) ' first sheet
oSheet = oDoc.Sheets("Sheet:1") ' sheet by name

' say there is a Partslist on the sheet.
Dim oPartslist As PartsList
oPartslist = oSheet.PartsLists(1)

' export the Partslist to Excel.

' folderName = "C:\temp"
folderName = ThisDoc.Path
oPartslist.Export(folderName & "\Partslist.xls", PartsListFileFormatEnum.kMicrosoftExcel)