algorithmic modeling for Rhino
Hi Guys,
I wrote a simple Python script which flattens z coordinate of points and create a new polyline with those points again. But it returns a message saying:
Message: Could not convert de7f8437-e21f-41be-9415-f912ae7bd8f5 to a list of points
Is there anyone to know how to fix the script?
Please help.
Thanks,
-------------------------------------------------------------
import rhinoscriptsyntax as rs
crv_01 = rs.GetObject ("Pick Crv",rs.filter.curve)
if rs.IsCurve(crv_01):
points = rs.CurveDiscontinuity(crv_01,2)
points.insert(0,rs.CurveStartPoint(crv_01))
points.append(rs.CurveEndPoint(crv_01))
count = 0
z_list=[]
x_list=[]
y_list=[]
for each_item in points:
z_list.append(points[count][2])
x_list.append(points[count][0])
y_list.append(points[count][1])
count += 1
z_list.sort()
z_top = z_list[count-1]
count2 = 0
point_f = []
for each_item in points:
point_temp = (x_list[count2], y_list[count2], z_top)
point_f = rs.AddPoint(point_temp)
count2 += 1
new_crv = rs.AddPolyline(point_f)
if new_crv : rs.AddPolyline(point_f)
----------------------------------------------------------------------
Tags:
AddPolyline needs a list of points however you are sending only one point (the last point on your list). Change
point_f = rs.AddPoint(point_temp)
to
point_f.append(rs.AddPoint(point_temp))
and it should work fine.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by