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

SclViewport delete

Overview

You can use this command to delete a viewport.

Synopsis

SclViewport delete <$viewportHandle>

Description

Deletes the viewport referred to by the viewport handle. When a viewport is deleted the space on the graphics workspace that it occupied is reclaimed by bordering viewports, usually this will be the viewport that had been previously split.

The system must maintain at least one viewport. If you attempt to remove the last viewport you will see an error message.

Arguments

  • delete
  • A literal string to identify the function.

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

Returns

If successful, this command returns $SCL_OK. If you try to delete the viewport when it is the only viewport in the system, an error message is returned.

Examples

# Create and then delete viewports
set vp1 [SclViewport getActive]
set vp2 [SclViewport split vertical 30 $vp1 ]
set vp3 [SclViewport split horizontal 50 $vp2 ]
puts "Click the mouse to remove viewports 1 and 2"
SclPause
SclViewport delete $vp1
SclViewport delete $vp2