Grasshopper

algorithmic modeling for Rhino

I divided a surface into a lot of sub surfaces. then I used "Sbox" to generate surface boxes.  
And I want to put these surface boxes into different lists by the area.
But after I connected output 'B' of "Sbox" to "C#", only type system.object doesn't report any error.

List<System.Object> B

Now the question is how can I used the Rhino class to get the area value of B[i]?
Is the type hint I chose right?
Can anyone help to answer this please? 

Views: 805

Replies to This Discussion

Twisted Boxes are defined inside the Transform.gha library and they are not part of the Grasshopper SDK. Therefore you cannot use them from within your script, as your script does not reference Transform.gha.

The data casting is clearly broken in 0.7 script parameters, so I'll need to fox that. But unless you want to call functions on the GH_TwistedBox through Reflection, you're stuck converting it to a Brep...


foreach (System.Object obj in B)
{
  Reflect(obj);

 Grasshopper.Kernel.Types.IGH_Goo box = (Grasshopper.Kernel.Types.IGH_Goo) obj;

 Rhino.Geometry.Brep brep = null;
 box.CastTo(out brep);

 doc.Objects.AddBrep(brep);
}


--
David Rutten
david@mcneel.com
Poprad, Slovakia

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service