hm_getcrossreferencedentities

Finds entities that reference the specified entity.

Syntax

hm_getcrossreferencedentities entity_type entity_name_or_id reference_flag output_mark_id string_array number_of_strings ?search_type? ?exclude_regions?

Type

HyperMesh Tcl Query

Description

Finds entities that reference the specified entity. This includes collected references, data name references and attribute entity references. Each type of entity that references the specified input entity is returned in a list, and the found entities are then placed on the specified mark for those entity types. See the list of supported entities for this command.

Inputs

entity_type
The type of entity to query.
entity_name_or_id
The name or ID of the entity.
reference_flag
The type of cross-reference entities to find. Bit values are used and the value is calculated as (Bit0 + 2*Bit1 + 4*Bit2).
Bit0
0 – Do not consider collected entity cross-references.
1 – Consider collected entity cross-references. If the specified entity is not a collected entity, nothing will be returned for this bit.
Bit1
0 – Do not consider data name entity cross-references.
1 – Consider data name entity cross-references. If the specified entity is not referenced by any data names, nothing will be returned for this bit.
Bit2
0 – Do not consider attribute entity cross-references.
1 – Consider attribute entity cross-references. If the specified entity is not referenced by any entity attributes, nothing will be returned for this bit. Only entities for the currently loaded template are considered.
output_mark_id
The ID of the mark to place the found cross-referenced entities on. Valid values are 1 and 2.
string_array
Reserved for future use. Must be set to 0.
number_of_strings
Reserved for future use. Must be set to 0.
search_type
By default, HyperMesh searches for entities by name, and if the name is not found, it then searches by ID. This option allows you to specify how the search for an entity should be conducted. Valid values are:
-byname - Search only by name.
-byid - Search only by ID.
exclude_regions
0 - Include region entities in the search (default).
1 - Exclude region entities in the search (default).

Examples

To get all entities that cross-reference component with ID 100 on mark 1 and highlight them on the screen:

foreach entity_type [hm_getcrossreferencedentities comps 100 7 1 0 0 -byid] {
    hm_highlightmark $entity_type 1 h
}

To get only collected entity cross-references for component with ID 100 on mark 2:

hm_getcrossreferencedentities comps 100 1 2 0 0 -byid

To get only data name entity cross-references for component with ID 100 on mark 1:

hm_getcrossreferencedentities comps 100 2 1 0 0 -byid

To get only attribute entity cross-references for component with ID 100 on mark 1:

hm_getcrossreferencedentities comps 100 4 1 0 0 -byid

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

10-SA1-130

2019 - Added new optional argument exclude_regions.