Hi Tim, the "context" object is only available inside a Rhino Command. Grasshopper operates completely outside of the command structure so there is no "context" to speak of.
However, while you're inside a Grasshopper Script component you do have access to "app" and "doc" fields. "app" is a pointer to the current MRhinoApp() instance and "doc" is essentially the same as "context.m_doc". Do note that anything you do to the Rhino document from inside Grasshopper will slip past the Undo Manager unnoticed. -- David Rutten [email protected] Robert McNeel & Associates On Mar 16, 8:02 pm, tim <[email protected]> wrote: > Thanks that helps a lot. I guess I had two questions, the first was > how to return surfaces. The second was how to call the > AddSurfaceObject method. I don't fully understand the vb.net > implementation because inside grasshopper you don't have the > context.m_doc object? What object does that method apply to? > Hopefully that makes sense? > thanks again for you help. > > On Mar 13, 3:16 pm, David Rutten <[email protected]> wrote: > > > Hi Tim, > > > if you want to output a list of surfaces from a scripting component, > > do the following: > > > ------------------------------------------------------------- > > Dim srf As New List(Of OnSurface) > > For i As Int32 = 0 To 99 > > Dim n_srf As OnSurface = <call surface code here> > > srf.Add(n_srf) > > Next > > A = srf > > ------------------------------------------------------------- > > > This code assumes you have an output parameter called A. > > > -- > > David Rutten > > [email protected] > > Robert McNeel & Associates > > > On Mar 13, 8:27 pm, tim <[email protected]> wrote: > > > > I am trying to do a custom subdivision of a surface with the vb.net > > > component and then return a list of subsurfaces. I have referenced > > > the VB.net sdk > > > example:http://en.wiki.mcneel.com/default.aspx/McNeel/SdkPlaneSurface > > > but am confused on the last part: > > > > context.m_doc.AddSurfaceObject( ps ); > > > context.m_doc.Redraw(); > > > > Any help in returning a list of surfaces through the grasshopper > > > component would be awesome or is this even possible?
