Message 1 of 4
iLogic exporting BoM including top assembly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am trying to make an iLogic rule that exports BoM to excel including iProperties from the exported assembly ideally on the first row. I have already found and edited some rules so I am able to export the BoM according to my template, so even the old assemblies get right column order and then I sort it with custom iProperty. How do I add the same iProperties from assembly to the first row of BoM?
'----------------------------------------------------------------------------------------------------- 'Check if assembly is active oDoc = ThisDoc.ModelDocument If oDoc.DocumentType = kPartDocumentObject Then MessageBox.Show("Pro export kusovníku musí být aktivní Sestava!", "Export kusovníku") Return End If '----------------------------------------------------------------------------------------------------- oDoc = ThisApplication.ActiveDocument Dim oBOM As BOM oBOM = oDoc.ComponentDefinition.BOM '----------------------------------------------------------------------------------------------------- 'Import BoM template Dim oPath As String oPath = "D:\Projekty\Tryskací zařízení\0KonecVaultu\Sablona_kusovniku_KS.xml" oBOM.ImportBOMCustomization(oPath) '----------------------------------------------------------------------------------------------------- 'Renumber BoM Dim activeAssembly As AssemblyDocument = ThisApplication.ActiveDocument Dim bomView As BOMView = activeAssembly.ComponentDefinition.BOM.BOMViews(2) Call BOMView.Sort("He_HeOnum", True) Call BOMView.Renumber(1, 1) 'Path for export CSVpath = ThisDoc.Path + "\" 'the structured view to 'all levels' oBOM.StructuredViewFirstLevelOnly = False 'Make sure that the structured view is enabled. oBOM.StructuredViewEnabled = True Dim oStructuredBOMView As BOMView oStructuredBOMView = oBOM.BOMViews.Item("Strukturované") 'Export the BOM view to an Excel file oStructuredBOMView.Export(CSVpath + ThisDoc.FileName(False) + ".xls", kMicrosoftExcelFormat) i = MessageBox.Show("Přejete si zobrazit náhled kusovníku?", "Náhled kusovníku", MessageBoxButtons.YesNo) If i = vbYes Then : launchviewer = 1 : Else : launchviewer = 0 : End If If launchviewer = 1 Then ThisDoc.Launch(CSVpath + ThisDoc.FileName(False) + ".xls")