Hi,
I am trying to create a ship hull using section curves. The section curves are created using Rhinoscript and I have the handles of each curve. I am not sure how to call the Loft function with apropriate options. Also, I need to make sure the curves are selected in a particular order so that the hull surface doesn’t get twisted. I am just learning to code in Rhinoscript and getting errors with the code below. I read this post, but coudn’t figureout how to select multiple curves at once in an order.
Can someone help me with the below code?
Dim Curves: Curves = Array( SternCrvI, SternCrvII, MidshpI, MidshpII, MidshpIII, FoSI, FoSII, FwdShould, BowOffset, Bow)
Rhino.SelectObject(Curves)
Dim commOpts: commOpts = " _Type=_Normal _Simplify=_None _Closed=_No _Enter"
Dim hullSrf: hullSrf = Rhino.Command("-_Loft" + commOpts, False)
Dim Curves: Curves = Array( SternCrvI, SternCrvII, MidshpI, MidshpII, MidshpIII, FoSI, FoSII, FwdShould, BowOffset, Bow)
Rhino.SelectObject(Curves)
Dim commOpts: commOpts = " _Type=_Normal _Simplify=_None _Closed=_No _Enter"
Dim hullSrf: hullSrf = Rhino.Command("-_Loft _enter" + commOpts, False)
You forgot an enter after -_Loft
I dont really know how to make the right order in rhinoscript
but i dont think that really matters if you gonna use Rhino.Command. Then Rhino will sort it itself.
Thanks @jordy1989 for replying. For now I am selecting all the surfaces individually as:
Rhino.UnselectAllObjects
Rhino.SelectObject(SternCrvI)
Rhino.SelectObject(SternCrvII)
Rhino.SelectObject(MidshpI)
Rhino.SelectObject(MidshpII)
Rhino.SelectObject(MidshpIII)
Rhino.SelectObject(FoSI)
Rhino.SelectObject(FoSII)
Rhino.SelectObject(FwdShould)
Rhino.SelectObject(BowOffset)
Rhino.SelectObject(Bow)
I don’t know how to select multiple surfaces in a single command. This however seems to be working for now. Let me know if you know how to select more than one surface in a single command.
As easy as rhino.selectobjects(Curves)