Exporting BOM view with ApprenticeServer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all,
I think this canbe a really short post. Is it a known issue that the ApprenticeServer cannot export BOM views directly to Excel? Or am I doing something wrong?
I'm using Inventor 2015 SP2 update 2.
The below code throws a system.notimplemented exception. The view is loaded correctly, I can read out the BOM values, but want to export with a single command instead of an exporting algorithm.
private void button1_Click(object sender, EventArgs e)
{
Inventor.ApprenticeServerComponent oApprServerComp = new Inventor.ApprenticeServerComponent();
Inventor.ApprenticeServerDocument oApprDoc = oApprServerComp.Open(@"C:\EPDM_DATA\ARB\SANDBOX\KLAAS\2D CAD\ANDY_EXPORTS\S400_10T\DPP-0372608.iam");
Inventor.AssemblyComponentDefinition oAssemblyCompDef = (Inventor.AssemblyComponentDefinition)oApprDoc.ComponentDefinition;
Inventor.BOMView view_model = null;
Inventor.BOMView view_structured = null;
Inventor.BOMView view_parts_only = null;
foreach (Inventor.BOMView view in oAssemblyCompDef.BOM.BOMViews)
{
if (view.ViewType.Equals(Inventor.BOMViewTypeEnum.kModelDataBOMViewType))
{
view_model = view;
}
if (view.ViewType.Equals(Inventor.BOMViewTypeEnum.kStructuredBOMViewType))
{
view_structured = view;
}
if (view.ViewType.Equals(Inventor.BOMViewTypeEnum.kPartsOnlyBOMViewType))
{
view_parts_only = view;
}
}
view_structured.Export(@"C:\temp\BOM-StructuredAllLevels.xls", Inventor.FileFormatEnum.kMicrosoftExcelFormat);
//view_structured.Export(@"C:\temp\BOM-StructuredAllLevels.txt", Inventor.FileFormatEnum.kTextFileTabDelimitedFormat);
//view_structured.Export(@"C:\temp\BOM-StructuredAllLevels.accdb", Inventor.FileFormatEnum.kMicrosoftAccessFormat);
}
Thanks for any help I can get on this!