You are here: Surpac Concepts > Macros > SCL > SWA Commands > SclGetStrings
GEOVIA Surpac

SclGetStrings

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.

A SWA contains a set of strings each of which contains a set of segments. To perform operations on the strings in a SWA you must obtain the handle to the set of strings in a SWA. This command performs this task.

Synopsis

$SwaHandle SclGetStrings StringsHandle

Description

Assign the handle to the set of strings to the StringsHandle variable for the SWA represented by the SwaHandle variable.

Arguments

  • SwaHandle
  • This variable must represent a SWA.

  • StringsHandle
  • Passed by reference. This variable will be assigned the handle to the set of strings for the specified SWA.

Examples

#
# This example shows how a count of the number of strings in the SWA
# can be obtained and also how a string at a specified position in the
# SWA can be obtained and assigned to a variable
#
SclGetActiveViewport ViewportHandle
$ViewportHandle SclGetActiveLayer SwaHandle
$SwaHandle SclGetStrings StringsHandle
set count [$StringsHandle SclCountItems]
puts "There are $count strings in the Swa"
for {set i 0} {$i < $count} {incr i} {
  $StringsHandle SclGetItem StringHandle $i
  puts "The string at position $i is [$StringHandle SclGetId]"
}