Ilogic to export the BOM.csv , file.csv was document corruption

Ilogic to export the BOM.csv , file.csv was document corruption

chenQS35U
Participant Participant
1,118 Views
3 Replies
Message 1 of 4

Ilogic to export the BOM.csv , file.csv was document corruption

chenQS35U
Participant
Participant

hello!

Have a problem that export the BOM(bill of material) with ilogic. And then. it was the document corruption for BOM file.

if i chose the yes, opening is no problem. Actually, i want to debug this problem. 

By the way, I choose the built-in function icon to export that was no problem.

Thank for your looking my problem

''-------------BOM(Bill of material)------------------
'ThisBOM.Export("Parts Only", "r_data.xls", kMicrosoftExcelFormat,"r_data")
ThisBOM.Export("Parts Only", "r_data.csv",  kMicrosoftExcelFormat,"r_data")

chenQS35U_0-1600393856118.png

 
 

 

 

 

 
0 Likes
Accepted solutions (1)
1,119 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Accepted solution

This is not a simple problem. I thought it might have to do with Excel's Trust Centre, but it turns out that the export from Inventor is actually using XML to save out the files to CSV.

 

If you use the API Sample (something like the code here) which I assume is more or less what you are using, the export is XML based (bottom part of the image). If you export manaully from Inventor's BoM interface, the export is a clean CSV file (top of image).

 

@ClintBrown3D Autodesk Inventor 153.png

I guess out of the box, you either have to live with the warning message, or manually export the BoM's.

 

BUT - I wrote some code a while back to export out sheet metal only parts to a text file. Perhaps you could edit this to create a custom CSV file. 

Message 3 of 4

Anonymous
Not applicable

Also worth mentioning that if you save it out as XLSX, it will open with no issues.

 

 

0 Likes
Message 4 of 4

chenQS35U
Participant
Participant

Before, I searched your Blog that help me a lot.

You will pretty nice person. Thanks for sharing your code.

This problem couldn't resolve in recent.

Yes, I got the warning message.

Actually my company needed the .csv file in recent. 

so.....I should export manually from Inventor BOM in this time. And then I will edit code to create a custom.csv file.

0 Likes