Yup,

you can do whatever you want inside the script component, as long as
you're outputting a data type that Grasshopper understands. I.e.
Doubles, Integers, Booleans, Strings, Points, Curves etc. all work
fine.

--
David Rutten
[email protected]
Robert McNeel & Associates

On Feb 8, 9:06 pm, oompa_l <[email protected]> wrote:
> thanks so much David.
>
> so if I wanted just the raw X, Y and Z data I would make three
> separate outputs and three different lists of Doubles within the
> VB.net code? I could then make the points by composing them afterward
> with the PointXYZ component? Just testing the waters...
>
> thanks again
>
> On Feb 8, 2:51 pm, David Rutten <[email protected]> wrote:
>
> > Hi oompa,
>
> > I made a file called "coordinates.txt" which contained some comma-
> > separated numbers (3 per line). I then put the path to this file (C:
> > \Users\David\Desktop\coordinates.txt) into a PostIt panel and fed it
> > into a VB component. I called the input parameter "path" and set the
> > hint to String.
>
> > The following code will examine all lines in the file and create a
> > list of points:
>
> > 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)
> >   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))
>
> >     pts.Add(New On3dPoint(x, y, z))
> >   Next
>
> >   A = pts
> > End Sub
>
> > --
> > David Rutten
> > [email protected]
> > Robert McNeel & Associates
>
> > On Feb 8, 2:09 am, oompa_l <[email protected]> wrote:
>
> > > Hi
>
> > > I am in the process of trying to understand the import of data into GH
> > > from excel, but I don't think I even need to get that fancy since my
> > > data is actually coming from a CSV text file. Does anyone know of any
> > > sample files that illustrate how to take a list of points in this
> > > format and produce GH geometry from it?
>
> > > thanks in advance
> > > o

Reply via email to