You are here: Surpac Concepts > Macros > SCL > Viewport and Layers > SclViewport > SclViewport setViewScale
GEOVIA Surpac

SclViewport setViewScale

Overview

You use this command to specify the scale for the viewport in the x, y, and z directions.

Synopsis

SclViewport setViewScale <$viewportHandle> <$x> <$y> <$z>

Description

Set the view scale for the viewport referred to by the handle. The scale values for the viewport are specified in each direction by the parameters x, y, and z. These parameters can be Tcl variables.

Arguments

  • setViewScale
  • A literal string to identify the function.

  • <$viewportHandle>
  • The reference handle to the viewport to set the view scale of.

  • <x>
  • The viewing scale in the x axis direction.

  • <y>
  • The viewing scale in the y axis direction.

  • <z>
  • The viewing scale in the z axis direction.

Returns

If successful, this command returns $SCL_OK. If the viewport handle is not valid, an error message is returned.

Examples

# Get and set the view scale for a viewport
set vp [SclViewport getActive]
SclViewport getViewScale $vp xScale yScale zScale
puts "Current viewing scale is X=$xScale ; Y=$yScale ; Z=$zScale"
# exaggerate the Y scale
SclViewport setViewScale $vp $xScale [expr $yScale * 2] $zScale
SclViewport getViewScale $vp xScale yScale zScale
puts "Viewing scale now X=$xScale ; Y=$yScale ; Z=$zScale"