*replacentitywithentity
Replaces a single component.
Syntax
*replacentitywithentity mode entity_type existing_id incoming_id string_array number_of_strings
Type
HyperMesh Tcl Modify Command
Description
This command replaces a single component.
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.
- existing_id
- The ID of the existing/old entity.
- incoming_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 301 with component 501 using a tolerance of 0.5, keeping the source material, property and card image:
*createmark comps 1 100
*replacesetentitydata componentmark=1 componentpairingstring={{301 501}}
*createstringarray 4 "tolerance=0.5" "keep_src_prop=1" "keep_src_mat=1" "keep_src_comp_cardimage=1"
*replacentitywithentity 1 comps 301 501 1 4
Errors
if { [ catch {command_name...} ] } {
# Handle error
}
Version History
13.0
2017.2 - This command used to work independently, but must now be preceded by a call to *replacesetentitydata.