You are here: Surpac Concepts > Macros > SCL > Block Model Commands > SclBlockModelGetParameter
GEOVIA Surpac

SclBlockModelGetParameter

Overview

You use this command to get the values of specific parameters of a block model. The parameters returned by this function are listed in the table under the parameterName argument. You use the values for the parameters when writing macros that interact with the block model. You must have the relevant block model open in Surpac to use this command.

Synopsis

SclBlockModelGetParameter $bmHandle $parameterName param1 param2 param3

Description

Assigns the values for the block model parameters to specified Tcl variables. The correct number of variables must be specified for each parameter, or a Tcl error will occur.

Arguments

  • bmHandle
  • Passed by value. The handle to the block model. You can obtain the handle by calling the SclBlockModelGetCurrentModel command.

  • parameterName
  • Passed by value. The name of the parameters required. The parameters this command can use are:

    parameterName Description Number of additional parameters param1 param2 param3
    origin Gets the x, y, and z coordinates that define the model 3 The name of the variable that the value for the model origin x is assigned to. The name of the variable that the value for the model origin y is assigned to. The name of the variable that the value for the model origin z is assigned to.
    extents Gets the size of the block model in the x, y, and z directions. 3 The name of the variable that the model size in the x direction is assigned to. The name of the variable that the model size in the y direction is assigned to. The name of the variable that the model size in the z direction is assigned to.
    isrotated Determines whether the model is rotated. 1 The name of the variable that is assigned "true", if the model is rotated, or "false", if the model is not rotated.
    rotation Gets the angle of rotation about each of the axes for a rotated model. If the model is not rotated, all values are 0. The units for the angles are decimal degrees. 3 The name of the variable that the rotation about the x axis (the bearing) is assigned to. The name of the variable that the rotation about the y axis (the dip) is assigned to. The name of the variable that the rotation about the z axis (the plunge) is assigned to.
    userblock Gets the dimensions of the user block size, in the x, y, and z directions. 3 The name of the variable that the user block size, in the x direction, is assigned to. The name of the variable that the user block size, in the y direction, is assigned to. The name of the variable that the user block size, in the z direction, is assigned to.
    userblocksubdivisionlevel Gets the subdivision level of the user block size. 1 The subdivision level for the user block size. For non-Surpac block models, a subdivision level of 1 is returned.
    maxblocksubdivisionlevel Gets the subdivision level of the maximum block size allowed in the model. 1 The subdivision level for the maximum block size. For variable models, where different values for the maximum X, Y and Z directions can occur, the maximum value is returned regardless of direction.
    minblock Gets the dimensions of the minimum block size defined for the model, in the x, y, and z directions. 3 The name of the variable that the minimum block size, in the x direction, is assigned to. The name of the variable that the minimum block size, in the y direction, is assigned to. The name of the variable that the minimum block size, in the z direction, is assigned to.
    modeltype Gets the value that indicates the model type. 1 The name of the variable that the model type (that is, "Standard", "Variable", or "Free") is assigned to.
    name Gets the name of the model file. 1 The name of the variable that the name of the model file is assigned to.
    path Gets the path to the directory that contains the model file. 1 The name of the variable that the path to the directory containing the model file is assigned to.

  • param1
  • Passed by reference. The name of the variable that the value for param1, in the previous table, is assigned to.

  • param2
  • Passed by reference. The name of the variable that the value for param2, in the previous table, is assigned to.

  • param3
  • Passed by reference. The name of the variable that the value for param3, in the previous table, is assigned to.

Returns

Returns $SCL_TRUE if you have used the correct command name and number of additional parameters. If the parameter name or number of additional parameters are invalid or incorrect, a Tcl error occurs and a warning message is displayed.

Examples

set handle [SclBlockModelGetCurrentModel]
puts "Block model handle = $handle"

SclBlockModelGetParameter $handle name nameVar
SclBlockModelGetParameter $handle path pathVar
SclBlockModelGetParameter $handle modeltype modeltypeVar
SclBlockModelGetParameter $handle isrotated isrotatedVar
SclBlockModelGetParameter $handle origin xorgVar yorgVar zorgVar
SclBlockModelGetParameter $handle extents xextVar yextVar zextVar
SclBlockModelGetParameter $handle userblock xuserVar yuserVar zuserVar
SclBlockModelGetParameter $handle minblock xminVar yminVar zminVar
SclBlockModelGetParameter $handle rotation bngVar dipVar plungeVar

puts "Model name=$nameVar, path=$pathVar"
puts "Model type=$modeltypeVar"
if {$isrotatedVar == "true"} {
	puts "Model rotation: bearing=$bngVar, dip=$dipVar, plunge=$plungeVar"
} else {
	puts "Model rotation: x=0, y=0, z=0"
}
puts "Model origin: x=$xorgVar, y=$yorgVar, z=$zorgVar"
puts "Model extent: x=$xextVar, y=$yextVar, z=$zextVar"
puts "Model user block size: x=$xuserVar, y=$yuserVar, z=$zuserVar"
puts "Model min block size: x=$xminVar, y=$yminVar, z=$zminVar"
						

 

# Find out the subdivision level at which user blocks exist.
# A block model must already be loaded for this to work.
set bm [SclBlockModelGetCurrentModel]
SclBlockModelGetParameter $bm userblocksubdivisionlevel userLevel
puts $userLevel

# Find out the subdivision level of the maximum block size in the model
# A block model must already be loaded for this to work.
set bm [SclBlockModelGetCurrentModel]
SclBlockModelGetParameter $bm maxblocksubdivisionlevel maxLevel
puts $maxLevel