hi you have two variables with the same name.
'Dim d As Double = Convert.ToDouble(parts(4))' and 'D = labels' before you say 'dim d' you already declared a variable with the name d in gh (for output).... just try another name for the output in GH or an other name for d... johannes On 14 Feb., 01:36, oompa_l <[email protected]> wrote: > Hi > > David helped show me how to parse a CSV file into geometry using > VB.net and everything was working - I was able to add more outputs, > and make something out of them. Then, I just added a little extra to > make text tags and it's screwed up what came before it - For some > reason the text tag is working (the newly added bit) but something > that was working before, now doesn't > > the following is the code in the not working form. It was the labels > that I added, the lines associated with it like Dim l As String = > Convert.ToString(parts(5)) and labels.Add(l) and D = labels. When I > added it I get an error message associated with the variable 'd' and > commenting out lines related to the list of depths rememedies the > error, but leaves me with no list of depths. Any ideas why an addition > would throw off something that was working before? > > Sub RunScript(ByVal path As String) > > If (Not IO.File.Exists(path)) Then Return False > > Dim lines As String() = IO.File.ReadAllLines(path) > If (lines Is Nothing) Then Return False > > Dim pts As New List(Of On3dPoint) > Dim radii As New List(Of Object) > Dim depth As New List(Of Object) > Dim labels As New List(Of Object) > > For Each line As String In lines > Dim parts As String() = line.Split(",".ToCharArray()) > > Dim x As Double = Convert.ToDouble(parts(0)) > Dim y As Double = Convert.ToDouble(parts(1)) > Dim z As Double = Convert.ToDouble(parts(2)) > > Dim r As Double = Convert.ToDouble(parts(3)) > Dim d As Double = Convert.ToDouble(parts(4)) > > Dim l As String = Convert.ToString(parts(5)) > > radii.Add(r) > depth.Add(d) > pts.Add(New On3dPoint(x, y, z)) > > labels.Add(l) > Next > > A = pts > B = radii > c = depth > D = labels > > End Sub > > #Region "Additional methods and Type declarations" > > #End Region > End Class
