I am making an console application for a 3D CAD program called Soplid Edge. With this application i let Visul Basic draw curves and lines in Solid Edge. To make the curves i calculate points, what get stored into an array, with an 4th degree equation. Now the problem. I read my data from a text file. But this text file has srveral lines for different curves. And my code read trough them all and takes the last line what has data in it. My question: How can i let my piece of code read the first line, calculate the points, make the curve and then does the same thing with the next line with data.
Here is my code that i want to get repeated for every line in my text file:
'Dmax(Array)
Dim listofdata As New ArrayList
For x = (0.2 * QT) To ((QFACTOR + 0.1) * QT) Step (0.1 * QT)
listofdata.Add(x)
y = (((x ^ 4) * C1) + ((x ^ 3) * C2) + ((x ^ 2) * C3) + (x * C4) + C5)
listofdata.Add(y)
Next
Dim dataArray() As Double
dataArray = DirectCast(listofdata.ToArray(GetType(Double)), Double())
' Creating a Curve2d object by using the above defined points
objCurves.AddByPoints(PointCount:=14, Points:=dataArray)
And this is how i read my file:
Console.Write("Path to file:")
Dim strFileName As String
strFileName = Console.ReadLine
Dim objFS As New FileStream(strFileName, FileMode.Open, FileAccess.Read)
Dim objSR As New StreamReader(objFS)