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

SclGraphicsLayers

Overview

The SWA (Surpac Work Area) is where all String and DTM data processed by Surpac applications is stored. A complete description of the SWA can be found here.

Synopsis

sclGraphicsLayers <suitable command> <command arguments>

Description

sclGraphicsLayers is a command that represents the set of all Graphics layers that exist at any point in time. Because of this the sclGraphicsLayers command by itself serves little purpose. Used with other commands that operate upon it though it is very useful.

Arguments

  • <suitable command>
  • May be one of a number of commands that operates on the sclGraphicsLayers set. Commands that may be used are:

    • SclCountItems
    • To obtain a count of the number of Swas in the set of Graphics layers.

    • SclGetItem
    • To get an item from the set of Graphics layers at a specified position.

    • SclIterateFirst
    • To create a new Scl iterator and make it ready for forward iteration through the set of Graphics layers.

    • SclIterateLast
    • To create a new Scl iterator and make it ready for reverse iteration through the set of Graphics layers.

    • SclIterateNext
    • To advance the iterator to the next Swa in the set of Graphics layers and return the handle to the next Swa.

    • SclIteratePrev
    • To advance the iterator to the previous Swa in the set of Graphics layers and return the handle to the previous Swa.

  • <command arguments>
  • Depending on the command that is applied to the SclSwas command, other arguments will be required. For details of each of these refer to the documentation on each of the commands above.

Examples

#
# This example iterates over all SWAs that exist as Graphics layers 
# and displays their names and handles in the message window.
#
puts "List of all Graphics layers that exist"
sclGraphicsLayers SclIterateFirst Iterator
while {[$Iterator SclIterateNext SwaHandle] == $SCL_TRUE} {
  puts "Swa handle = $SwaHandle, swa name = [$SwaHandle SclGetId]"
}

 

#
# This example shows how a count of the number of SWAs in the set of 
# Graphics layers can be obtained and also how a SWA at a specified 
# position in the set of Graphics layers be obtained and assigned to a 
# variable
#
set count [sclGraphicsLayers SclCountItems]
puts "There are $count Swas in the set of Graphics Layers"
for {set i 0} {$i < $count} {incr i} {
  set status [sclGraphicsLayers SclGetItem SwaHandle $i]
  puts "status=$status"
  puts "The Graphics Layer at position $i is [$SwaHandle SclGetId]"
}