You are here: Surpac Concepts > Macros > SCL > Drillhole Commands > SclDrillholeMaxDepth
GEOVIA Surpac

SclDrillholeMaxDepth

Overview

This command assigns the maximum drillhole depth (obtained from the collar table) to a variable name supplied in the argument list. A geology database must be connected for this command to execute successfully.

Synopsis

$DatabaseHandle SclDrillholeMaxDepth $holeid maxdepth

Description

Assign the maximum depth of the drillhole, the value obtained from the collar table, to the last argument in the parameter list.

Arguments

  • DatabaseHandle
  • The variable must contain a valid geology database handle.

  • holeid
  • Passed by value. The hole ID for which the maximum hole depth is required.

  • depth
  • Passed by reference. This is the variable to which the maximum downhole depth is to be assigned.

Returns

Returns $SCL_TRUE on successful execution. Throws a TCL error if there is no database connected or if the specified drillhole does not exist in the database.

Examples

#
# Open a database and display max depth for all drillholes
# then close the database before the script terminates
#
SclOpenDatabase DatabaseHandle "woody.ddb"
#
# create a query to iterate over all holes in the collar table
#
$DatabaseHandle SclQuery QueryHandle "collar"
$QueryHandle SclQueryColumn "hole_id"
$QueryHandle SclProcess
$QueryHandle SclGetIterator QueryIterator
while {[$QueryIterator SclIterateNext RowHandle] == $SCL_TRUE} {
  set hole_id [$RowHandle SclGetValueByName "hole_id"]
  $DatabaseHandle SclDrillholeMaxDepth $hole_id maxdepth
  puts "Hole ID=$hole_id, maxdepth=$maxdepth"
}
SclDestroy QueryHandle
SclCloseDatabase DatabaseHandle 
		

 

#
# Get the handle to an existing database and display down XYZ
# values, azimuth and dip at 2m intervals - leave the database
# connected on completion
#
if {[sclDatabases SclCountItems] < 1} {
  error "No databases are connected"
} 
sclDatabases SclGetItem DatabaseHandle 0
#
# create a query to iterate over all holes in the collar table
#
$DatabaseHandle SclQuery QueryHandle "collar"
$QueryHandle SclQueryColumn "hole_id"
$QueryHandle SclProcess
$QueryHandle SclGetIterator QueryIterator
while {[$QueryIterator SclIterateNext RowHandle] == $SCL_TRUE} {
  set hole_id [$RowHandle SclGetValueByName "hole_id"]
  $DatabaseHandle SclDrillholeMaxDepth $hole_id maxdepth
  puts "Hole ID=$hole_id, maxdepth=$maxdepth"
}
SclDestroy QueryHandle