*CE_MarkUpdateLinkGroup
Allows search and replace of existing link information in the specified connector mark with new link information.
Syntax
*CE_MarkUpdateLinkGroup mark_id search_type search_rule replace_type replace_rule search_list_and_update_list_string_array total_string_array_length search_list_length replace_state ?keep_current_state?
Type
HyperMesh Tcl Modify
Description
Allows search and replace of existing link information in the specified connector mark with new link information.
Inputs
- mark_id
- Mark of connectors.
- search_type
- The entity type to search in the connector. This must be specified. The supported entities are comps, props, assems, surfs, tags, elems, nodes and parts.
- search_rule
- The rule by which the link entity was added to the connector. The following codes define the different rules:
- replace_type
- The type of entity that replaces the found link entity (search_type) in the connector. If not specified, the entity type information is not replaced for the found link (replace_type = search_type). The supported types are the same as that for search_type.
- replace_rule
- The rule to set for the found link entity. All the rules supported for search_rule parameters are supported.
- search_list_and_update_list_string_array
- A string array created using *createstringarray, containing the list of search IDs/names/UIDs, and the list of replace IDs/names/UIDs. This must be set to 1.
- total_string_array_length
- The total number of strings in the string array (search list + replace list).
- search_list_length
- The number of strings/items in the search list. The replace list length = total_string_array_length - search_list_length.
- replace_state
- The flag to set for the link entity that specifies if you are connecting to mesh or to geometry. The supported values are:
- ?keep_current_state?
- Optional option to keep the current connector state after the update operation. Valid states are:
Example
To replace component 1 with component group (3 and 4) across all displayed connectors:
*createmark connectors 1 "displayed";
set search_list [list 1];
set replace_list [list 3 4];
set string_list [concat $search_list $replace_list];
set total_length [llength $string_list];
set search_length [llength $search_list];
eval *createstringarray $total_length $string_list;
*CE_MarkUpdateLinkGroup 1 comps 2 comps 2 1 $total_length $search_length 0 0;
To replace component group (1 and 2) with component group (3 and 4) across all displayed connectors:
*createmark connectors 1 "displayed";
set search_list [list 1 2];
set replace_list [list 3 4];
set string_list [concat $search_list $replace_list];
set total_length [llength $string_list];
set search_length [llength $search_list];
eval *createstringarray $total_length $string_list;
*CE_MarkUpdateLinkGroup 1 comps 2 comps 2 1 $total_length $search_length 0 0;
To update the link rule of component group (1 and 2) to “use name” across all displayed connectors:
*createmark connectors 1 "displayed";
set search_list [list 1 2];
set replace_list [list];
set string_list [concat $search_list $replace_list];
set total_length [llength $string_list];
set search_length [llength $search_list];
eval *createstringarray $total_length $string_list;
*CE_MarkUpdateLinkGroup 1 comps 2 comps 3 1 $total_length $search_length 0 0;
Errors
if { [ catch {command_name...} ] } {
# Handle error
}
Version History
2017.2