SclBlockModelIterateEnd
Overview
You use this command to close, and remove, an Scl block model iterator, and free any memory resources associated with that iterator.
Synopsis
SclBlockModelIterateEnd $iterator
Description
You use this command when you no longer need the specified iterator. When working with large block models, closing the iterator can free a considerable amount of memory.
Arguments
- iterator
Passed by value. This is the handle to the iterator. For more information, see SclBlockModelIterateStart. If the specified iterator is invalid an error is returned and the script stops.
Returns
If this command is successful, it returns $SCL_OK. If there is an error, it returns $SCL_FALSE.
Examples
#Create an iterator for a specified block model which uses all attributes and no constraint file.
#Iterate over all blocks in the model, outputting the values for the attributes to the message window.
# A block model must already be loaded for this to work.
set bm [SclBlockModelGetCurrentModel]
set iterator [SclBlockModelIterateStart $bm]
set result [SclBlockModelIterateNext $iterator attributeValues]
while {$result != -1} {
foreach value $attributeValues {
puts -nonewline "$value, "
}
puts ""
set result [SclBlockModelIterateNext $iterator attributeValues]
}
SclBlockModelIterateEnd $iterator
|
#Create an iterator for a specified block model which uses a specific set of attributes and no constraint file.
#Iterate over all blocks in the model, outputting the values for the attributes to the message window.
#A block model must already be loaded for this to work.
set bm [SclBlockModelGetCurrentModel]
#Example attribute names
set attributeList {"att1" "att2" "att3"}
set iterator [SclBlockModelIterateStart $bm $attributeList]
set result [SclBlockModelIterateNext $iterator attributeValues]
while {$result != -1} {
foreach value $attributeValues {
puts -nonewline "$value, "
}
puts ""
set result [SclBlockModelIterateNext $iterator attributeValues]
}
SclBlockModelIterateEnd $iterator
|
#Create an iterator for a specified block model which uses a specific set of attributes and a constraint file.
#Iterate over all blocks in the model, outputting the values for the attributes to the message window.
#A block model must already be loaded for this to work.
set bm [SclBlockModelGetCurrentModel]
#Example attribute names
set attributeList {"att1" "att2" "att3"}
#Example constraint file name
set constraintFileName "c:\\constraintfile.con"
set iterator [SclBlockModelIterateStart $bm $attributeList $constraintFileName]
set result [SclBlockModelIterateNext $iterator attributeValues]
while {$result != -1} {
foreach value $attributeValues {
puts -nonewline "$value, "
}
puts ""
set result [SclBlockModelIterateNext $iterator attributeValues]
}
SclBlockModelIterateEnd $iterator
|