Python, trying to use rs.Command() to Revolve a curve

I am trying to Revolve a curve I created in Python. I cannot find a direct call to Revolve command in rs. Therefore I am using a rs.Command call. It works if I use the interactive window to select to Resolve parameters, but I am not able to pass these directly in Python. Here is my code.

import rhinoscriptsyntax as rs
import Rhino

r1 = 10
d = 30
r2 = 12

curve1 = rs.AddPolyline([[0,0,0], [0,r1,0]])
curve2 = rs.AddCurve([[0,r1,0], [0.5 * d,r1,0], [0.5 * d,r2,0], [d,r2,0]])
curve3 = rs.AddPolyline([[d,r2,0], [d,0,0]])

shape = rs.JoinCurves([curve1, curve2, curve3],delete_input=True, tolerance=None)

rs.Command("-_Revolve SelID %s _Enter 0,0,0 1,0,0 0 360"%(rs.coercecurve(shape)))

I tried to directly pass shape instead of rs.coercecurve(shape), not better. I also tried to pass options (_FullCircle) but this also failed. Nevertheless just calling rs.Command("-_Revolve ") does what I expect it to do. So basically I suppose that I do something wrong passing the parameter.

I think you are looking for rs.AddRevSrf (curve_id, axis, start_angle=0.0, end_angle=360.0)
(check the Help for more details)

HTH, --Mitch

1 Like

YES ! Thanks !