rotate#

view_transf.rotate(p0: float, p1: float, p2: float) int#

Specifies a rotation (in degrees about each of the axes). Used for global, frame, and tool transformations.

Since transformations can be different per viewport, this can be set for each viewport, thus a viewport selection is needed if more than one viewport is being used.
Args:
p0:

‘x_ang’ number of degrees to rotate about the x,y,z axes. (sign is according to the right-hand rule)

p1:

‘y_ang’ number of degrees to rotate about the x,y,z axes. (sign is according to the right-hand rule)

p2:

‘z_ang’ number of degrees to rotate about the x,y,z axes. (sign is according to the right-hand rule)

Examples:
# 
# Selecting viewport(s) 
# 
ensight.viewport.select_begin(2)
# 
# Set the axis to x 
# and rotate about the x axis 15 degrees 
# 
ensight.view_transf.axis("x")
ensight.view_transf.rotate(15.000000,0.000000,0.000000)
# 
# Set the axis to be y 
# and translate one unit in the -negative y direction 
# 
ensight.view_transf.axis("y")
ensight.view_transf.translate(0.0000e+00,-1.0000e+00,0.0000e+00)
# 
# Now showing it with a plane tool rotation 
# 
ensight.tools.plane("ON")
ensight.view_transf.function("plane")
ensight.view_transf.rotate(0.000000,-39.575481,0.000000)
ensight.view_transf.function("global")
# 
# And now with a local transformation 
# 
ensight.part.select_default()
ensight.frame.create()
ensight.frame.select_begin(1)
ensight.part.select_begin(1)
ensight.frame.assign(1)
ensight.view_transf.function("local")
ensight.view_transf.axis("y")
ensight.view_transf.rotate(0.000000,27.000000,0.000000)
Returns:

zero on success, non-zero on error