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

SclBlockModelRotateCoordinates

Overview

You use this command to transform coordinate values between model space coordinates and world coordinates for the block model. You must have the block model open in Surpac to use this command.

Synopsis

SclBlockModelRotateCoordinates $bmHandle $rotateCommand $xin $yin $zin xout yout zout

Description

Transforms the model coordinates to world coordinates, or world coordinates to model coordinates, depending on the value of the rotate command.

Note: Floating point rounding errors can result in insignificant variations to values if you transform coordinates from model to world coordinates and back again.

Arguments

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

  • rotateCommand
  • Passed by value. The command that determines if you are rotating model coordinates to world, or world coordinates to model. If you are rotating from model to world, the command is "modeltoworld". If you are rotating from world to model, the command is "worldtomodel".

  • xin
  • Passed by value. The x value to rotate from the input coordinate system (model or world) to the output coordinate system (world or model).

  • yin
  • Passed by value. The y value to rotate from the input coordinate system (model or world) to the output coordinate system (world or model).

  • zin
  • Passed by value. The z value to rotate from the input coordinate system (model or world) to the output coordinate system (world or model).

  • xout
  • Passed by reference. The name of the variable to which the rotated x value is assigned.

  • yout
  • Passed by reference. The name of the variable to which the rotated y value is assigned.

  • zout
  • Passed by reference. The name of the variable to which the rotated z value is assigned.

Returns

If the transformation is successful, $SCL_OK is returned. If an incorrect value is used for the rotateCommand parameter, or an incorrect number of paramenters is used for the command, a Tcl error occurs.

Examples

#rotate model space coordinates to real world and back and display the 
# results in the message window
set handle [SclBlockModelGetCurrentModel]
puts "Block model handle = $handle"

SclBlockModelRotateCoordinates $handle modeltoworld 0.0 0.0 0.0 xW yW zW
SclBlockModelRotateCoordinates $handle worldtomodel $xW $yW $zW xmod ymod zmod

puts "Model x,y,z (0, 0, 0) = world x,y,z ($xW, $yW, $zW)"
puts "World x,y,z ($xW, $yW, $zW) = modelx,y,z ($xmod, $ymod, $zmod)"