Grasshopper

algorithmic modeling for Rhino

I can't quite figure out why this won't work. I get an error on the last line. It seems that I can not cast a lineCurve as a curve. NOt sure how to make a line into a curve.

Thanks for the help

Private Sub RunScript(ByVal x As List(Of Line), ByVal y As Object, ByRef A As Object, ByRef B As Object)
'------Convert Lines to LineCurves--------------'
'------Convert Lines to LineCurves--------------'
Dim i As Integer
Dim lineList As New List(Of Line)
Dim lineCont As New Line
Dim myLineCurveList As New List(Of LineCurve)

For i = 0 To x.Count - 1

lineCont = x(i)
lineList.Add(lineCont)
Next

For Each lineCont In lineLIst
Dim myLineCurve As New LineCurve(lineCont)

myLineCurveList.Add(myLineCurve)

Next
'------End Convert Lines to LineCurves--------------'
'------End Convert Lines to LineCurves--------------'


A = LineCurve.JoinCurves(myLineCurveList)



End Sub

Views: 212

Replies to This Discussion

Hi, 

it is not tested but it should work.

Dim i As Int32
Dim lineCont As NurbsCurve
Dim lineList As New List(Of Curve)

For i = 0 To x.Count - 1
lineCont = Nurbscurve.CreateFromLine(x(i))
lineList.Add(lineCont)
Next
A = Curve.JoinCurves(LineList)

Best

Marios

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2025   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service