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

SclViewport split

Overview

You use the SclViewport split command to split the viewport, horizontally or vertically, into two new viewports.

Synopsis

SclViewport split <orientation> <percentage> <$viewportHandle>

Description

Creates two viewports from one existing viewport. The new viewport is sized according to the percentage you specify with the original viewport occupying the remaining space.

There is a practical limit to how small a viewport can become. If you try to split a viewport that reaches the limit you will see an error message.

A reference handle to the new viewport is returned. This handle is used to access the available set of viewport functions and the SclSetValueByName and SclGetValueByName attribute commands.

Arguments

  • split
  • A literal string to identify the function.

  • <orientation>
  • The orientation of the split given as the literal string horizontal or vertical.

  • <percentage>
  • The percentage of the current viewport that you are resizing the new viewport to. The value must be between 0 - 100.

  • <$viewportHandle>
  • The reference handle to the viewport to be split.

Returns

This function returns a reference handle to the new viewport. This reference handle is passed as a parameter to other SclViewport functions and can be used with the SclSetValueByName and SclGetValueByName attribute commands.

Examples

# Split the main viewport into three
set vp1 [SclViewport getActive]
set vp2 [SclViewport split vertical 30 $vp1 ]
set vp3 [SclViewport split horizontal 50 $vp2 ]