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 type | Description of ID |
|---|---|
| Point | The point number within the segment containing the point starting from 0 for the first point in the segment. |
| Segment | The segment number within the string containing the segment starting from 0 for the first segment in the string |
| String | The string number assigned using the SclCreatestring command. A positive integer with zero not a permitted value. |
| Triangle | The triangle identifier. A positive integer with zero not a permitted value. |
| Trisolation | The trisolation identifier. A positive integer with zero not a permitted value. |
| Triobject | The trisobject identifier. A positive integer with zero not a permitted value. |
| Swa | The Swa name assigned using the SclCreateSwa command |
| Viewport | The viewport name assigned by the system to a viewport. |
| Database | The name of the database |
| Table | The name of the database table |
| Column | The name of the table column |
| Row handle | All 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]" |