@kggadhavi wrote:
import rhinoscriptsyntax as rs import math class MyPolygon: def __init__(self, radius, sides): self.radius = radius self.sides = sides #variable theta theta = (2 *math.pi)/self.sides pt01 = rs.AddPoint(self.radius,0,0) pts = [] pts.append(pt01) self.origin = [0,0,0] #radians to degrees degree = theta*(180/math.pi) #rotate object method i need a loop for i in range (1,self.sides): tempPt = pts[-1]#it will give me the last item form an array newPt = rs.RotateObject(tempPt, self.origin, degree, None, True) pts.append(newPt) pts.append(pt01) self.polygon = rs.PolylineVertices(tempPt) polygon1 = MyPolygon(5,5)I am getting following error message:
Message: unable to convert 8de8acb9-2bf3-4f90-a848-c03254349161 into Curve geometry
Traceback:
line 567, in coercecurve, "C:\Users\Kuldeep\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\utility.py"
line 2317, in PolylineVertices, "C:\Users\Kuldeep\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\curve.py"
line 23, in init, "E:\Digital Media Master\3rd Semester\Rhino Exercises\Polygon.py"
line 24, in , “E:\Digital Media Master\3rd Semester\Rhino Exercises\Polygon.py”
Posts: 8
Participants: 4