- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @Zachary.BeasonD97A7 & @A.Acheson.
I honesty had not used that CustomTable.Export method in a long time, so I was mostly just making general observations & suggestions that seemed logical to me, and drawing from memory and referencing the online help page for that method. After reviewing that post from around 9 months ago about exporting BOM's, I'm guessing that might have been the last time I dealt with a similar case.
So, I just created a couple of custom tables in one of my test drawings, then created a quickie local iLogic rule to export those two tables to Excel, using that same method. I gave both tables on the drawing different titles and different contents. I then created all the options I was going to use before the loop, using the oOptions.Add() method, then to set the 'TableName' value for each table within the loop, I used the oOptions.Value("TableName") = "Table Name " & i.
However, I am now experiencing the issue at hand myself. The second table overwrites the first table, even if both tables on the drawing had different titles, and both loops gave the 'TableName' option a different value. This is obviously a negative limitation of that built-in method. So, if this were a major part of my job, and I needed a solution that would create each table on a new tab/sheet in the Excel file, I would devise a new strategy. Either write each table to a new Excel file by incrementing the file name each time, then combine the sheets of those Excel files into one later (maybe manually at first, but might be possible by code too). If the Excel file you specify doesn't exist, it will create the Excel file for you. Or I would create my own custom Sub for this task, to use instead of that built-in CustomTable.Export method. And I would probably go to the Inventor Ideas forum and if I didn't find an idea there for this, I would create one, to help urge Autodesk to either update this method, or create a second version of it, that would work the way we want it to work.
Wesley Crihfield
(Not an Autodesk Employee)