SclBlockModelBlockIndexFromXYZ
Overview
You use this command to get the index of a block, at a specified subdivision level, for a given XYZ location, in a block model.
Synopsis
SclBlockModelBlockIndexFromXYZ $bmHandle $level $x $y $z blockStatus
Description
Returns the index of the block that exists at the specified level and x, y, z coordinate. The status of the block is also returned in the blockStatus parameter.
Arguments
- bmHandle
- Level
- x
- y
- z
- blockStatus
Passed by value. This is the handle to the block model, obtained from the call to SclBlockModelGetCurrentModel.
Passed by value. The subdivision level for the block. This must be more than 0 and less than the maximum subdivision level for the block model.
Note: The level of the block determines the size of the block. Level 0 is the entire model. The higher the level the smaller the block size.
Passed by value. The x coordinate.
Passed by value. The y coordinate.
Passed by value. The z coordinate.
Passed by reference. Returns the status of the block at the specified level and x, y, z coordinate. This is -1 for a white block, 0 for a black block, and 1 for a grey block.
Note: A black block is one that has been explicitly assigned a value, a grey block is one that has been subdivided (and consequently has no values), a white block is one that has no value and which exists within the block model limits. One purpose of having white blocks is to extend the block model so that you can potentially reblock a block model into that empty space.
Returns
If the coordinates are in the model space, the block index is returned. If the coordinates are outside the model space, -1 is returned. If an error occurs, $SCL_FALSE is returned.
Examples
# Find out the block index at a specified subdivision level for a given XYZ location in a Block Model. # A block model must already be loaded for this to work. set bm [SclBlockModelGetCurrentModel] set blockIndex [SclBlockModelBlockIndexFromXYZ $bm 2 1800 7600 100 blockStatus] puts $blockIndex puts $blockStatus |