algorithmic modeling for Rhino
Public Overrides Function Parse(ByVal data As String, _
Byval options As EH_ReadFileComponent.EH_ParseOptions) As Object
Dim coord As String() = Nothing
coord = data.Split(",")
Dim pos As String
For Each pos In coord
C = coord
Next pos
End Function
Tags:
/*
file content:
0,0,0
12,12,12
1.2,1.22,3.5
12,1.2,1.2
*/
// read File
string path = @"C:\Users\you\Desktop\points.txt";
FileStream my_stream = File.OpenRead(file_path);
System.IO.StreamReader my_reader = new System.IO.StreamReader(my_stream);
List<string> my_lines = new List<string>();
while (my_reader.Peek() >= 0)
{
my_lines.Add(my_reader.ReadLine());
}
my_stream.Dispose();
my_reader.Dispose();
List<Point3d> my_points3d = new List<Point3d>();
// generate Points
for(int i = 0;my_lines.Count > i;i++)
{
string[] xyz_info = my_lines[i].Split(',');
Point3d insert_pt = new Point3d(Convert.ToDouble(xyz_info[0]), Convert.ToDouble(xyz_info[1]), Convert.ToDouble(xyz_info[2]));
my_points3d.Add(insert_pt);
}
A = my_points3d;
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
© 2024 Created by Scott Davidson. Powered by