Grasshopper

algorithmic modeling for Rhino

Hi there,

I've had a look around and found some potential solutions but I haven't been able to implement them. I could just be doing something in a weird way.. In learning Python I've created a component which creates a series of points, 2 curves and then lofts those curves. I'm getting the output "IronPython.Runtime.List" where I'd be expecting the loft surface. 

From searching around this could be because I need to flatten my curve list?? I haven't been able to do that however.

Any help appreciated :)

Code below:

import rhinoscriptsyntax as rs
import math

startPt = []
endPt = []
chordPt = []
chordLn = []
loftSrf = []

for i in range(xLength):
startPt.append(rs.AddPoint(i,0,math.sin(i)/2))
endPt.append(rs.AddPoint(i,yWidth,math.cos(i)))

chordPt = startPt + endPt

chordLn.append(rs.AddInterpCurve(startPt))
chordLn.append(rs.AddInterpCurve(endPt))

loftSrf.append(rs.AddLoftSrf(chordLn))

Views: 694

Attachments:

Replies to This Discussion

most of the rhinoscript methods return arrays as I am aware.

So I suppose if you don't append but rather assign the value such as

loftSrf=rs.AddLoftSrf(chordLn)

it will work.

Cheers

M

Great, thanks Marios, that worked!

Do I not need to append because the list / variable is empty to begin with?

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service