Hi Jeremy!
I create loft using next code:
Private Function CreateLoftForm(document As Autodesk.Revit.DB.Document) As Form
Dim loftForm As Form = Nothing
Dim rpa As New ReferencePointArray()
Dim ref_ar_ar As New ReferenceArrayArray()
Dim ref_ar As New ReferenceArray()
Dim rp As ReferencePoint = Nothing
Dim xyz As XYZ = Nothing
Dim TransGlobal As Transaction = New Transaction(document)
TransGlobal.Start("Create loft")
xyz = document.Application.Create.NewXYZ(85.138522515, 45.303356517, 101.706036745)
rp = document.FamilyCreate.NewReferencePoint(xyz)
rpa.Append(rp)
xyz = document.Application.Create.NewXYZ(85.383921301, 35.572182287, 101.706036745)
rp = document.FamilyCreate.NewReferencePoint(xyz)
rpa.Append(rp)
xyz = document.Application.Create.NewXYZ(85.363870218, 35.083519311, 102.034120735)
rp = document.FamilyCreate.NewReferencePoint(xyz)
rpa.Append(rp)
xyz = document.Application.Create.NewXYZ(84.757225743, 28.25298673, 102.034120735)
rp = document.FamilyCreate.NewReferencePoint(xyz)
rpa.Append(rp)
xyz = document.Application.Create.NewXYZ(84.689869322, 27.761501607, 102.362204724)
rp = document.FamilyCreate.NewReferencePoint(xyz)
rpa.Append(rp)
xyz = document.Application.Create.NewXYZ(83.219675545, 20.111233411, 102.362204724)
rp = document.FamilyCreate.NewReferencePoint(xyz)
rpa.Append(rp)
xyz = document.Application.Create.NewXYZ(83.126540038, 19.735242886, 102.690288714)
rp = document.FamilyCreate.NewReferencePoint(xyz)
rpa.Append(rp)
Dim cbp As CurveByPoints = document.FamilyCreate.NewCurveByPoints(rpa)
ref_ar.Append(cbp.GeometryCurve.Reference)
ref_ar_ar.Append(ref_ar)
rpa.Clear()
ref_ar = New ReferenceArray()
xyz = document.Application.Create.NewXYZ(85.138522515, 45.303356517, 114.829397126)
rp = document.FamilyCreate.NewReferencePoint(xyz)
rpa.Append(rp)
xyz = document.Application.Create.NewXYZ(85.383921301, 35.572182287, 115.157481116)
rp = document.FamilyCreate.NewReferencePoint(xyz)
rpa.Append(rp)
xyz = document.Application.Create.NewXYZ(85.363870218, 35.083519311, 115.157481116)
rp = document.FamilyCreate.NewReferencePoint(xyz)
rpa.Append(rp)
xyz = document.Application.Create.NewXYZ(84.757225743, 28.25298673, 115.485565105)
rp = document.FamilyCreate.NewReferencePoint(xyz)
rpa.Append(rp)
xyz = document.Application.Create.NewXYZ(84.689869322, 27.761501607, 115.485565105)
rp = document.FamilyCreate.NewReferencePoint(xyz)
rpa.Append(rp)
xyz = document.Application.Create.NewXYZ(83.219675545, 20.111233411, 115.813649095)
rp = document.FamilyCreate.NewReferencePoint(xyz)
rpa.Append(rp)
xyz = document.Application.Create.NewXYZ(83.126540038, 19.735242886, 115.813649095)
rp = document.FamilyCreate.NewReferencePoint(xyz)
rpa.Append(rp)
cbp = document.FamilyCreate.NewCurveByPoints(rpa)
ref_ar.Append(cbp.GeometryCurve.Reference)
ref_ar_ar.Append(ref_ar)
rpa.Clear()
ref_ar = New ReferenceArray()
loftForm = document.FamilyCreate.NewLoftForm(True, ref_ar_ar)
TransGlobal.Commit()
Return loftForm
End Function
As a result, I get:
I would like, that points would be connected not by "waves", but by lines. Is it possible?