Rotate an object 3D

I made a scrip to rotate with copy an object rotating it two angles but an error appear:

Dim arrObjects, arrPoint, arrvector1,arrvector2,lastObject1
arrObjects = Rhino.GetObjects("Select objects to rotate")
arrPoint = Array(0.0, 0.0, 0.0)
arrvector1= Array(0.0, 1.0, 0.0)
arrvector2= Array(0.0, 0.0, 1.0)
Rhino.RotateObjects arrObjects, arrPoint,92.1466,arrvector1,TRUE
lastObject1 = Rhino.LastCreatedObjects
Rhino.RotateObjects lastObject1, arrPoint,80.7656,arrvector2,FALSE
Rhino.RotateObjects arrObjects, arrPoint,66.6523,arrvector1,TRUE
lastObject1 = Rhino.LastCreatedObjects
Rhino.RotateObjects lastObject1, arrPoint,118.2595,arrvector2,FALSE

Only worked the first RotateObjects, then the second one generates an error:
“Type mismatch in parameter: Array is required”
It seems that lastObject1 failed, I tried also using lastObject but also failed.
I think a “LastCopiedObjects” command should exist

Hi @Javier_Lopez,

Since you not scripting a Rhino command, such as Rotate, you should not be calling Rhino.LastCreastedObjects.

– Dale