AddVbRule "volume_extraction" 'Output parameters names and values to a comma delimited CSV file fileheader = "Parameters Report for " & ThisDoc.PathAndFileName(True) 'first line header of csv file description = "Main Parameters and their values" '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) & "_Axial_Position_Search.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() 'blank line oWrite.WriteLine("z" & delimiter & "Cone-Shaft" & delimiter & "Inner Cone-Shaft") inner_cone_intersection = 0 Cone_Position = 0 increment = 0.1 While inner_cone_intersection = 0 RuleParametersOutput InventorVb.DocumentUpdate() Dim bodies As New SolidBodies(ThisDoc.Document) cone_intersection = bodies.Body("CONE").Volume inner_cone_intersection = bodies.Body("INNER_CONE").Volume oWrite.WriteLine(i & delimiter & cone_intersection & delimiter & inner_cone_intersection) Cone_Position += increment End While oWrite.Close() 'option to view report go = MessageBox.Show("Would you like to view the csv file?", "iLogic CSV Output", MessageBoxButtons.YesNo) If go = 6 Then ThisDoc.Launch(csv_filename)