Grasshopper

algorithmic modeling for Rhino

Im trying to test some of the rhino common classes with C# and im not getting output with Rhino.Geometry.Box method:

 

 

public Box( Plane basePlane, Interval xSize,

        Interval ySize,
Interval zSize)


http://www.rhino3d.com/5/rhinocommon/



<code>


private void RunScript(double x, double y, double z, Plane p, ref object A)
{

Rhino.Geometry.Box ghBox = new Rhino.Geometry.Box(p, x, y, z);
A = ghBox;

//your code here…
}



</code>


if anyone can give me a hand that would be great
also not sure why my code tags arnt working

Views: 1757

Replies to This Discussion

Hi, probably because you're not giving an Interval as it requires in the x, y, and z.

From the type hint choose Interval innstead of double.

 

Bye

Hi Charles,

as Andrea is saying, you need an Interval in x, y, z directions. See an example here:

private void RunScript(double x, double y, double z, Plane p, ref object A)
  {
    Interval xInterval = new Interval(-x, x);
    Interval yInterval = new Interval(-y, y);
    Interval zInterval = new Interval(-z, z);

    Box ghBox = new Box(p, xInterval, yInterval, zInterval);
    A = ghBox;
  }

Do you see the Intellisense-like boxes if you press Ctrl+Shift+Space inside a parenthesis?

- Giulio

_______________

giulio@mcneel.com

McNeel Europe, Barcelona

Perfect, thanks Giulio and Andrea, it clearly states Interval in the documentation, I guess because ive never seen interval I skipped over it for some reason. If one of you have a second please explain what this means...

"The interval between [A and B] on the X axis of the plane",

then the same for Y, and Z. These intervals constitute the box.

 

- Giulio

_______________

giulio@mcneel.com

McNeel Europe, Barcelona

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service