Grasshopper

algorithmic modeling for Rhino

Hi,
I am trying to draw a box using VB in Grasshopper. I successfully get a RMA.OpenNurbs.OnBox. However, this doesn't get displayed in the RHINO viewport. Any ideas how to get the boxes to display?

Views: 372

Replies to This Discussion

Try EH_Box:

Dim e As New Grasshopper.Kernel.Types.EH_Box(onutil.On_xy_plane, 10, 10, 10)
a = e
Vicente,
I'm starting to see that in VB, you can mix native grasshopper components and native Rhino parts. Is there documentation to know which native grasshopper components are accessible from VB?

For example, this EH_Box feature is available and works but I don't see the equivalent for "Cylinders". We had to resort to native Rhino ONCylinder to draw it.

Any thoughts?
Hi Kermin,

The following does display fine at my end:

Sub RunScript(ByVal corners As List(Of On3dPoint))
Dim box As New OnBrep
box = OnUtil.ON_BrepBox(corners.ToArray)

A = box
End Sub
Rajaa,
Thanks. That works.

I guess the bigger question would be how do we know when to use OpenNurbs objects (referencing the .Net SDK), Grasshopper objects (Grasshopper.Kernel.Types) or OnUtil. geometry objects?

Any guidance?

Thanks again.
Hi,
Grasshopper types still not documented properly for efficient use. This will be coming at some point. In general I'd use GH types when they are not available in OpenNURBS (for example the data tree). GH does the casting internally for ON types.

OpenNURBS has all geometry classes/types. You can use them to create geometry of that type, but you need to know which method to use to set the member variables properly. In more comlex geometry, like a box, edge surface, etc, there are functions in the SDK that does it for you. These functions are under one of 2 name spaces. RhUtil and OnUtil. It takes a bit of digging and asking around to see which is most appropriate in each case.

I hope this helps.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service