hm_getreferencedentitiesmark

Finds entities that are referenced by the entities on the specified mark.

Syntax

hm_getreferencedentitiesmark entity_type mark_id reference_flag output_mark_id string_array number_of_strings

Type

HyperMesh Tcl Query

Description

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

Inputs

entity_type
The type of entity to query.
mark_id
The ID of the mark containing the entities. Valid values are 1 and 2.
reference_flag
The type of referenced 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 references.
1 – Consider collected entity references. If the specified entity is not a collector or is empty, nothing will be returned for this bit.
Bit1
0 – Do not consider data name entity references.
1 – Consider data name entity references. If the specified entity does not have any data name references, nothing will be returned for this bit.
Bit2
0 – Do not consider attribute entity references.
1 – Consider attribute entity references. If the specified entity does not have any attribute entity references, 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 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.

Examples

To get all entities referenced by components with IDs 100-110 on mark 1 and highlight them on the screen:

*createmark comps 2 100-110
foreach entity_type [hm_getreferencedentitiesmark comps 2 7 1 0 0 -byid] {
    hm_highlightmark $entity_type 1 h
}

To get only collected entity references for components with IDs 100-110 on mark 2:

*createmark comps 1 100-110
hm_getreferencedentitiesmark comps 1 1 2 0 0 -byid

To get only data name entity references for components with IDs 100-110 on mark 1:

*createmark comps 2 100-110
hm_getreferencedentitiesmark comps 2 2 1 0 0 -byid

To get only attribute entity references for components with IDs 100-110 on mark 1:

*createmark comps 2 100-110
hm_getreferencedentitiesmark comps 2 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

11.0