translate#
- view_transf.translate(p0: float, p1: float, p2: float) int #
Specifies a translation in each of the coordinate directions. 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_dist’ distance to translate in the x, y, z directions
- p1:
‘y_dist’ distance to translate in the x, y, z directions
- p2:
‘z_dist’ distance to translate in the x, y, z directions
- Examples:
# # Sets the function to cursor mode # and translates the cursor # ensight.view_transf.function("cursor") ensight.view_transf.translate(0.295634,-0.014792,-0.144601) # # Return to global transformation mode # ensight.view_transf.function("global") # # Does some global transformations # (one of which is a translate) # ensight.view_transf.zoom(1.431051) ensight.view_transf.rotate(-1.071430,21.547768,0.000000) ensight.view_transf.translate(0.620558,0.000000,0.000000) # # Sets Frame transform mode (local) # ensight.view_transf.function("local") # # Selects the viewport and frame to use # ensight.viewport.select_begin(3) ensight.frame.select_begin(1) # # And translate the parts attached to frame 1 # ensight.view_transf.translate(0.0000E+00,-4.0000e+00,0.0000e+00) # # Return to global transformation mode # ensight.view_transf.function("global")
- Returns:
zero on success, non-zero on error