I don't know why the iLogic code that you mention is providing only a fixed order of columns. VBA would give you more flexibility.
If you still want to use iLogic, it is relatively easy to change the column orderr AFTER the file is created.
In attached code , I create a CSV file called C:\Users\User\Documents\Inventor\bom.csv
You can influence the column order by changing the order of the numbers on this line in the code:
displayorder = {9, 3, 2, 4, 5, 6, 7, 8, 1}
In my example of 9 columns, I swapped columns 1 and 9 around and also columns 2 and 3.
Cheers
Bob
'Default BOM order
'1 = BOM Structure
'2 = Description
'3 = Item
'4 = Part Number
'5 = REV
'6 = Stock Number
'7 = Thumbnail
'8 = QTY
'9 = Unit QTY
Dim displayorder As Array
'displayorder = {1, 2, 3, 4, 5, 6, 7, 8, 9} ' default
displayorder = {9, 3, 2, 4, 5, 6, 7, 8, 1}
Dim filename = "C:\Users\User\Documents\Inventor\bom.csv"
ThisBOM.Export("Parts Only", filename, kTextFileCommaDelimitedFormat)
Dim tempfile As String
Dim i As Integer
tempfile = filename + "_tmp"
Dim ReadCSV As New System.IO.StreamReader(filename)
Dim TestArray As New ArrayList()
Dim oFile As System.IO.File
Dim oWrite As System.IO.StreamWriter
oWrite = oFile.CreateText(tempfile)
Dim textline As String
Dim j As Integer
j=0
Do While ReadCSV.Peek <> -1 ' Loop until end of file.
Testarray.Add(ReadCSV.ReadLine.Split(","))
Dim newstr As String
newstr = ""
For i = 0 To UBound(displayorder)
If newstr <> "" Then
newstr = newstr + "," + TestArray (j) (displayorder(i)-1)
Else
newstr = TestArray (j) (displayorder(i)-1)
End If
Next i
j= j+1
oWrite.WriteLine(newstr)
Loop
ReadCSV.Close()
oWrite.Close()
System.IO.File.Delete( filename )
System.io.File.Move(tempfile, filename)
Bob Van der Donck
Principal UX designer DMG group