You are here: Surpac Concepts > Macros > SCL > Object Manipulation > SclGetId
GEOVIA Surpac

SclGetId

Overview

All Scl objects have an identifier that may be used for a variety of purposes. The SclGetId command returns the value of this object identifier for use in Scl scripts. Examples of object identifiers are:

  • String number
  • Triobject number
  • Swa name
  • Viewport name
  • Database name
  • Table name
  • Column name

Synopsis

$ObjectHandle SclGetId

Description

Return the identifier for the specified object as the result of the command.

Arguments

  • ObjectHandle
  • The ObjectHandle variable must contain the handle to a valid Scl object so that its identifier can be returned as the result of the command. The table below shows the identifier returned for each of the different Scl objects types.

    Scl Object typeDescription of ID
    PointThe point number within the segment containing the point starting from 0 for the first point in the segment.
    SegmentThe segment number within the string containing the segment starting from 0 for the first segment in the string
    StringThe string number assigned using the SclCreatestring command. A positive integer with zero not a permitted value.
    TriangleThe triangle identifier. A positive integer with zero not a permitted value.
    TrisolationThe trisolation identifier. A positive integer with zero not a permitted value.
    TriobjectThe trisobject identifier. A positive integer with zero not a permitted value.
    SwaThe Swa name assigned using the SclCreateSwa command
    ViewportThe viewport name assigned by the system to a viewport.
    DatabaseThe name of the database
    TableThe name of the database table
    ColumnThe name of the table column
    Row handleAll values retrieved by the row will be returned as the ID with a - seperator

Returns

The identifier for the specified object.

Examples

#
# This example selects a point and then climbs the heirarchy all the
# way to the SWA object level displaying details for each successive parent
#
# Execute this script after a string file has been loaded into a
# graphics layer
set status [SclSelectPoint PointHandle "Select a point" layer string_id segment_no point_no x y z desc ]
if {$status == $SCL_OK} {
  puts "Selected point ID = [$PointHandle SclGetId]"
  $PointHandle SclGetParent SegmentHandle
  puts "Selected segment ID = [$SegmentHandle SclGetId]"
  $SegmentHandle SclGetParent StringHandle
  puts "Selected string Id = [$StringHandle SclGetId]"
  
  $StringHandle SclGetParent SwaHandle
  puts "Selected Swa Id  = [$SwaHandle SclGetId]"
} else {
  puts "Cancel was pressed"
}

 

#
# This example selects a triangle and then climbs the heirarchy all the
# way to the SWA object level displaying details for each successive parent
#
# Execute this script after a DTM file has been loaded into a
# graphics layer
#
set status [SclSelectTriangle TriangleHandle "Select a triangle" layer triobject_no trisolation_no triangle_no]
if {$status == $SCL_OK} {
  puts "Selected triangle Id = [$TriangleHandle SclGetId]"
  $TriangleHandle SclGetParent TrisolationHandle
  puts "Selected trisolation Id = [$TrisolationHandle SclGetId]"
  $TrisolationHandle SclGetParent TriobjectHandle
  puts "Selected triobject Id = [$TriobjectHandle SclGetId]"
  
  $TriobjectHandle SclGetParent SwaHandle
  puts "Selected Swa Id = [$SwaHandle SclGetId]"
} else {
  puts "Cancel was pressed"
}

 

# 
# This example displays the Id of the active viewport and its
# active graphics layer (swa)
# 
SclGetActiveViewport ViewportHandle
$ViewportHandle SclGetActiveLayer SwaHandle
puts "Active viewport Id = [$ViewportHandle SclGetId]"