GiD - The personal pre and post processor

replace

objarray replace <obj> <index_start> <index_end> <obj_to_insert>

Replace the block from index_start to index_end by another objarray (that must be of the same type)

<obj> the objarray to be modified

<index_start> <index_end> integer indices of the block to be replaced

<obj_to_insert> objarray to be inserted

Warning: the values of <obj> itself are modified, without creating another copy of the object

e.g.

set obj [objarray new_from_to intarray 1 12] -> 1 2 3 4 5 6 7 8 9 10 11 12 set obj_insert [objarray new_from_to intarray 20 25] -> 20 21 22 23 24 25 objarray replace $obj 4 5 $obj_insert -> obj = {1 2 3 4 20 21 22 23 24 25 7 8 9 10 11 12} set obj_empty [objarray new intarray 0] objarray replace $obj 4 9 $obj_empty -> obj = {1 2 3 4 7 8 9 10 11 12}

COPYRIGHT © 2022 · GID · CIMNE