I am not able to rotate my Cylinder at 90 degree ant help please?

#import rs script

import rhinoscriptsyntax as rs
import math
#define a center point
base=rs.GetPoint(“Base of Cylinder”)
bPt = base

#define the height of Cylinder
height = rs.GetPoint(“Which height do you want for Cylinder?”)
hPt = height

#define a radius
myRadius=rs.GetReal(“Define the Radius”)
rPt = myRadius

#create a Cylinder
obj = rs.AddCylinder(bPt,hPt,rPt, cap = True)

#rotate on vertcle axis
rs.RotateObjects(obj,bPt,90)

rs.RotateObjects(obj,bPt,90)

RotateObjects() is looking for a list (with one or more objects) and you are feeding it a single object (GUID). So you should use instead:

rs.RotateObject(obj,bPt,90)

This will also work:

rs.RotateObjects([obj],bPt,90)

(a list with one object)

HTH, --Mitch

1 Like