What I'm going to ask is probably very simplistic and naive since i don't know how the internals work too well. But when the popup list appears when writing code the are seem to be some GH components like EH_box, EH_circle, EH_curve (I assume EH is from 'explicit history'). So I thought maybe there was a way (or there will be a way) of using the grasshopper component 'loft' inside the scripting component instead calling the SDK loft directly. So it would be as simple as: (here comes the most naive part of the post)
Having as input parameter of the scripting component 'loft_curves' and 'A' as output: Dim loft As New GH_Loft() loft.inputcurves = loft_curves.ToArray() A = loft.outputgeometry On Oct 20, 1:11 pm, David Rutten <[EMAIL PROTECTED]> wrote: > Hi Adam, > > Lofting is not easy. You have to construct a new instance of > MArgsRhinoLoft, which contains all the loft settings and curves. Then, > you have to call RhUtil.RhinoSdkLoftSurface and pass it your > arguments. There's no function in the SDK which is as easy as > Rhino.AddLoftSrf in RhinoScript. I agree that there should be, but > there isn't. > > Let's assume you have a collection of 100 OnCurves, and you want to > loft the first 10: > > 1) Create a new list of MRhinoLoftCurve and populate it using a loop > > Dim loft_curves As New List(Of MRhinoLoftCurve) > For i As Integer = 0 To 9 > Dim crv_section As New MRhinoLoftCurve() > crv_section.m_curve = m_original_curves(i).DuplicateCurve() > crv_section.m_bClosed = m_original_curves(i).IsClosed() > crv_section.m_bIsPlanar = m_original_curves(i).IsPlanar() > loft_curves.Add(crv_section) > Next > > 2) Then, create new MArgsRhinoLoft and populate the values: > > Dim loft_args As New MArgsRhinoLoft() > loft_args.m_loftcurves = loft_curves.ToArray() > loft_args.SetClosed(<<value that indicates whether you want a closed > loft of not>>) > ....<<set other loft settings in similar fashion>> > > 3) Finally, call the RMA.Rhino.RhUtil.RhinoSdkLoftSurface() function > with loft_args and an array of OnNurbsSurfaces. > > -- > David Rutten > Robert McNeel & Associates > > On Oct 20, 1:48 pm, "Adam Holloway" <[EMAIL PROTECTED]> wrote: > > > I'm relatively new to scripting. I want to sort a number of curves, in > > different lists, and then loft them periodically in the scripting > > component. What is the best way to do this? I've looked through the sample > > code for SDKLoft but the different classes confused me and I wasn't sure > > what was appropriate for this. > > > Thanks, > > Adam
