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

SclBlockModelDestroyConstraint

Overview

You use this command to destroy a block model constraint that is in memory.

Synopsis

SclBlockModelDestroyConstraint $constraintHandle

Description

The constraint, referred to by the handle, that is in memory is removed and the resources that were allocated to it are freed.

Arguments

Returns

Returns $SCL_OK if the constraint is destroyed successfully. Returns $SCL_FALSE if an error occurs and the constraint is not destroyed.

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