Grasshopper

algorithmic modeling for Rhino

Hello everyone,

I'm writing a component that receives a list of lines and declares a matrix members(mem.count,8). 

for some reason mem.Count == 0, no matter how many lines I attach as input.

private List<Matrix> assemble(List<Polyline> mem, List<Point3d> jt, Matrix sp, Matrix lc)
{
  List<Matrix> data = new List<Matrix>();
   Matrix members = new Matrix(mem.Count, 8);
  Matrix fixd = new Matrix(jt.Count,1);
  Matrix free = new Matrix(jt.Count, 1);
  for (int i = 0; i <= mem.Count; i++)
  {
    members[i, 0] = i + 1;
    members[i, 1] = mem[i].X[0];
    members[i, 2] = mem[i].Y[0];
    members[i, 3] = mem[i].Z[0];
    members[i, 4] = mem[i].X[1];
    members[i, 5] = mem[i].X[1];
    members[i, 6] = mem[i].X[1];
    members[i, 7] = mem[i].Length;

  }
  data.Add(members);


  return data;

Thanks

Views: 339

Replies to This Discussion

File?

of course

Attachments:

An sln file does not contain any code, it's just the bookkeeping file used by Visual Studio. You'll have to either copy-paste the entire component code, or upload a cs file.

sorry here it is..

Attachments:

solved

thank you anyways

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service