*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 Command

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:
0 - Undefined
1 - None
2 - Use ID
3 - Use name
4 - Proximity
5 - Use UID
The rule must be specified to perform a search.
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.
The string has two pieces:
1) The first part is a search list of IDs/names/UIDs based on the search_rule.
2) The second part is a replace list of IDs/names/UIDs based on the replace_rule.
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:
0 - Undefined
1 - Connect to mesh
2 - Connect to geometry
?keep_current_state?
Optional option to keep the current connector state after the update operation. Valid states are:
0 - Unrealize if needed (default)
1 - Keep current state
At most, one of the "replace" data must be specified to see a change in the link attributes. If the replace data exactly matches the search data, the connector is not unrealized and no change is made to the link entity.

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

Incorrect usage results in a Tcl error. To detect errors, you can use the catch command:
if { [ catch {command_name...} ] } {
   # Handle error
}

Version History

2017.2