Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to sort the BOM by "Description" and a custom parameter "LENGTH", my problem is that I have to add the parameter "LENGTH" manually every time, if I do not add it I get an error
"The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))"
I would prefer if iLogick did it automatically so I don't have to remember about it.
Public Sub Main() Dim oAssyDoc As AssemblyDocument oAssyDoc = ThisApplication.ActiveDocument Dim oAssyCompDef As AssemblyComponentDefinition oAssyCompDef = oAssyDoc.ComponentDefinition Dim oBOM As BOM oBOM = oAssyCompDef.BOM oBOM.StructuredViewEnabled = True Dim oBOMView As BOMView oBOMView = oBOM.BOMViews.Item("Structured") Trace.WriteLine("oBOM.BOMViews.Item(Structured)") oBOM.StructuredViewFirstLevelOnly = False Try oBOMView.Sort("Description", True, "LENGTH", True) oBOMView.Renumber(1, 1) Catch MessageBox.Show("The program has failed", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop) MessageBox.Show("ADD PARAMETER TO BOM:" & vbCrLf & "GO TO 'Bill of material' > Open Tab 'Structured' > 'Add Custom iProperty Columns' > add parameter with name 'LENGTH' ", "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop) Exit Sub End Try End Sub
Solved! Go to Solution.