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

BOMView.Export method not outputing any file.

Hi

I am trying to export Bom from an assembly using API. on most Assemblies it  works fine but some times method don't generate any output file. if I manually export bom by opening assembly in inventor it works fine but through API its not exporting any file.

I don't get any exception or error just no export file.

I am using External application to launch inventor silently then open document and export BOM.

 here is code I am using to export BOM.

      if (document.DocumentType == DocumentTypeEnum.kAssemblyDocumentObject)
       {
          var assemblyDoc = (AssemblyDocument) document;
          var bom = assemblyDoc.ComponentDefinition.BOM;
          bom.StructuredViewFirstLevelOnly = true;
          bom.StructuredViewEnabled = true;
          if (System.IO.File.Exists(csvTempFilePath)) System.IO.File.Delete(csvTempFilePat);
          var bomView = bom.BOMViews["Structured"];
          bomView.Export(csvTempFilePath, FileFormatEnum.kTextFileTabDelimitedFormat);
       }

 

Why export don't work for some assemblies any help?

Thanks