*replaceentitywithentity
Replaces a single entity with another.
Syntax
*replaceentitywithentity mode entity_type old_id new_id string_array number_of_strings
Type
HyperMesh Tcl Modify
Description
This command replaces a single entity with another.
Inputs
- mode
- The replace mode. Valid values are:
- 0 – Undo/reject replace operation.
- 1 – Initial replace operation.
- 2 – Finish/accept replace operation.
- entity_type
- The type of entity to replace. Currently only supported for comps.
- old_id
- The ID of the outgoing/old entity.
- new_id
- The ID of the incoming/new entity.
- string_array
- The ID of the string array that contains the input options. The string array is created using the *createstringarray command. This should always be set to 1.
- number_of_strings
- Integer indicating the size (number of strings) in the string array created using *createstringarray.
Example
To replace component 100 with component 2000 using a tolerance of 0.5, keeping the source material, property, include and card image, and writing to a log file:
*createstringarray 6 "tolerance=0.5" "keep_src_prop=1" "keep_src_mat=1" "keep_src_comp_cardimage=1" "log_file=C:/temp/replace_log.txt" "keep_src_include=1"
*replacentitywithentity 1 comps 100 2000 1 6
*createstringarray 6 "tolerance=0.5" "keep_src_prop=1" "keep_src_mat=1" "keep_src_comp_cardimage=1" "log_file=C:/temp/replace_log.txt" "keep_src_include=1"
*replacentitywithentity 2 comps 100 2000 1 6
Errors
Incorrect usage results in a Tcl error. To
detect errors, you can use the catch
command:
if { [ catch {command_name...} ] } {
# Handle error
}
Version History
13.0