Code:
fileheader = "Parameter-Report " & ThisDoc.FileName 'first line header of csv file
description = "Variierte Parameter und ihre Werte" 'use this variable in the body of the html
delimiter = ";" 'character to separate the names and values on each line'CSV filename uses this documents path and filename with a .csv extention
Dim oFile As System.IO.File
Dim oWrite As System.IO.StreamWriter
csv_filename = ThisDoc.PathAndFileName(False) & ".csv"
oWrite = oFile.CreateText(csv_filename) 'name and path of csv file to create/overwrite
oWrite.WriteLine(fileheader) 'include the fileheader on the first line
oWrite.WriteLine(description) 'include the description on the second line
oWrite.WriteLine(Now()) 'include the current date and time on the third line
oWrite.WriteLine() 'blank line
oWrite.WriteLine("Material:" & delimiter & iProperties.Material)
oWrite.WriteLine()
oWrite.WriteLine("Fußabstand" & delimiter & "Fußbreite" & delimiter & "Masse" & delimiter & "Anzahl")
oWrite.WriteLine("[mm]" & delimiter & "[mm]" & delimiter & "[g]" & delimiter & "[Stk]")
For FA = 50 To 100 Step 20
For FBI = 15 To 25 Step 1
RuleParametersOutput
InventorVb.DocumentUpdate()
volume = iProperties.Volume
mass = Round(iProperties.Mass, 2)
oWrite.WriteLine(FA & delimiter & FBI & delimiter & mass & delimiter & NP)
Next
Next
oWrite.Close()
'Report anzeigen
go = MessageBox.Show("Parameter-Report öffnen?", "iLogic CSV Output", MessageBoxButtons.YesNo)
If go = 6 Then ThisDoc.Launch(csv_filename)