Rhinoscript addLoft surface with EndPoint

Dear all,

I would like to draw, using script, an open Loft surface based on 3 closed curve and an End point.

I tried to use this function:
Rhino.AddLoftSrf (arrObjects [, arrStartPt [, arrEndPt[, intType [, intStyle [, nValue [, blnClosed]]]]]])

I have already drawn the 3 curve and the end point.
I can use the basic funcion correcttly:

Dim arrObjects
arrObjects = Rhino.ObjectsByType(4)
Rhino.AddLoftSrf arrObjects

But when I try to improve the function setting the other option I can’t get anything.
The option that I want to include are this:

Dim arrCurve
arrCurve = Rhino.ObjectsByType(4)

Dim arrStartPt
arrStartPt = none

Dim arrEndPt
arrEndPt = Rhino.ObjectsByType(1)

Dim intType
inType = 0 'normal surfaced

Dim intStyle
intStyle = 0 'not simplify

Dim nValue
nValue = none 'as I choose Style = 0

Dim blnClosed
blnClosed = False 'open surface

PLEASE, SOMEONE CAN HELP ME TO WRITE CORRECTLY THE FUNCTION???
It’s very hard to me, every attempt has failed, probably I am doing something wrong in the syntax or in setting the variables.
THANKS A LOT IN ADVANCE FOR ANY HELP

Laura Micoli

I suspect this isn’t helping. Usually the variable you set should be the variable you Dim. :wink:

Hi,
this help for sure, but I really don’t know ho o write the full instuction.

Rhino.AddLoftSrf arrObjects 'how I have to write the other option here, after this??? I tried in many way but it never work… :frowning:

Hi @laura.micoli,

Here is a simple example of using Rhino.AddLoftSrf:

Sub TestAddLoftSrf()
	
	' Declare local variables
	Dim strLine0, strLine1, strLine2
	Dim arrLines, arrEnd
	
	' Create some lines to loft
	strLine0 = Rhino.AddLine(Array(0, 0, 0), Array(10, 0, 0))
	strLine1 = Rhino.AddLine(Array(0, 5, 5), Array(10, 5, 5))
	strLine2 = Rhino.AddLine(Array(0, 10, 0), Array(10, 10, 0))
	
	' Array the lines
	arrLines = Array(strLine0, strLine1, strLine2)
	
	' Define end point
	arrEnd = Array(5, 15, 5)
	
	' Loft away
	Call Rhino.AddLoftSrf(arrLines, , arrEnd)
	
	' Delete the construction geometry
	Call Rhino.DeleteObjects(arrLines)

End Sub

– Dale

Dear Dale,

thanks a lot for your help.
I’ll try and I let you know how it works!

Have a nice day :slight_smile:
Laura

Dear Dale,

I tried your script coping and running it in my edit script panel.
Unfortunately, seams it doesn’t work.
:frowning:
Laura

Hi @laura.micoli,

Seems to work here:

– Dale