algorithmic modeling for Rhino
Dear All,
For the File I/O tutorial from the GH Primer Second Addition (VB.net) I have a simple question.
When trying to loop through the text lines from the file and convert them to a double I am running into the issue with the .ToCharArray below.
I'm sure the issue is that this is a method from the previous .Net SDK.
Any insight on how split the characters by the "," and put it into the parts array?
'Loop through lines
For Each line As String In lines
'Tokenize line into array of strings separated by ","
Dim parts As String() = line.Split(",".ToCharArray() ) <------Error
'Make sure that each line has exactly 3 values
'If UBound(parts) <> 2 Then Continue For
'Convert each coordinate from string to double
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 Point3d(x, y, z))
Next
As always many thanks
Tags:
Dim parts As String() = line.Split(New Char() {","c})
David,
your comment about GH being 90% interface and 10% geometry raises a question in my mind. I am wondering if Grasshopper's geometry calculation functions come from within rhino or work completely independently. The reason I ask is that I think it would be very appealing to be able to develop geometry producing definitions withing GH and Rhino but be able to spin off little self contained apps that could take in data, do calcs, and spit geometry files out the other side!
Matt
It's mostly Rhino. Curves and Surfaces, Breps and Meshes, Vectors and Planes, without Rhino none of this would work.
The only geometric stuff I do myself is Spatial-Trees, Delaunay, Voronoi and Metaballs, which are then translated into Rhino data types when they're finished.
--
David Rutten
david@mcneel.com
Leusden, NL
Yeah. That's what I initially thought. But when you mentioned the geometry manipulation done by GH I was curious if I was wrong about that!
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by