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

SclViewport setExtents

Overview

You use this function to specify the extents of the viewport in the x, y, and z directions.

Synopsis

SclViewport setExtents <$viewportHandle> <$minx> <$maxx> <$miny> <$maxy> <$minz> <$maxz>

Description

Set the extents for the viewport referred to by the handle. The viewport extents for the x, y, and z directions are specified in the parameter positions and can be Tcl variables.

Arguments

  • setExtents
  • A literal string to identify the function.

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

  • <$minx> and <$maxx>
  • The minimum and maximum values along the x axis direction.

  • <$miny> and <$maxy>
  • The minimum and maximum values along the y axis direction.

  • <$minz> and <$maxz>
  • The minimum and maximum values along 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 extents for a viewport
set vp [SclViewport getActive]
SclViewport getExtents $vp minX maxX minY maxY minZ maxZ
puts "Current extents are X $minX - $maxX Y $minY - $maxY Z $minZ - $maxZ"
set minX [expr $minX - 50]; set maxX [expr $maxX + 50];
set minY [expr $minY - 50]; set maxY [expr $maxY + 50];
set minZ [expr $minZ - 50]; set maxZ [expr $maxZ + 50];
SclViewport setExtents $vp $minX $maxX $minY $maxY $minZ $maxZ
SclViewport getExtents $vp minX maxX minY maxY minZ maxZ
puts "Extents are now X $minX - $maxX Y $minY - $maxY Z $minZ - $maxZ"