SclBlockModelAddBlockToConstraint
Overview
You use this command to add a block to a block model constraint object that is currently in memory.
Synopsis
SclBlockModelAddBlockToConstraint $constraintHandle $blockIndex
Description
The block, referred to by the blockIndex parameter, is added to the constraint.
Arguments
- constraintHandle
- blockIndex
Passed by value. The handle to the constraint that is in memory.
Passed by value. The index of the block that you want to add to the constraint.
Returns
Returns $SCL_OK if the block is added to the constraint successfully. Returns $SCL_FALSE if an error occurs, and the block is not added to the constraint.
Examples
#This script will create a constraint on the specified block model.
#10 blocks are added to the constraint, and the constraint is then saved
# to a file for re-use.
#After the file is created, the constraint handle is destroyed.
set bm [SclBlockModelGetCurrentModel]
set constraintHandle [SclBlockModelCreateConstraint $bm]
set iterator [SclBlockModelIterateStart $bm]
set count 0
while {$count < 10} {
set blockIndex [SclBlockModelIterateNext $iterator attributeValues]
set result [SclBlockModelAddBlockToConstraint $constraintHandle $blockIndex]
incr count
}
set result [SclBlockModelSaveConstraint $constraintHandle "constraint.con"]
set result [SclBlockModelDestroyConstraint $constraintHandle]
SclBlockModelIterateEnd $iterator
|