Model.hm_getcrossreferencedentitiesmark#
- Model.hm_getcrossreferencedentitiesmark(collection, reference_flag, outputCollectionSet, string_array=0, number_of_strings=0, exclude_regions=0)#
Finds entities that reference the entities on the specified collection, including collected references, data name references, and attribute entity references; each type of referencing entity is returned in a list, and the found entities are placed on the specified collection for those entity types. See the list of supported entities for
hm_getcrossreferencedentities().- Parameters:
collection (Collection) – The collection containing the entities to query.
reference_flag (int) –
The type of cross-reference entities to find.
Bit values are used and the value is calculated as (Bit0 + 2*Bit1 + 4*Bit2). Valid Bit options are:
Bit0
Consideration of collected entity cross-references. Valid values are:
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
Consideration of data name entity cross-references. Valid values are:
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
Consideration of attribute entity cross-references. Valid values are:
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.
Show Bit value calculator
Radio Button Table Option Name value Consideration of collected entity cross-references (Bit0) Consideration of data name entity cross-references (Bit1) Consideration of attribute entity cross-references (Bit2) Calculated argument value: 0 outputCollectionSet (CollectionSet) – The set of collections containing possibly multiple type of entities.
string_array (int) – Reserved for future development. Must be set to 0.
number_of_strings (int) – Reserved for future development. Must be set to 0.
exclude_regions (int) –
0 - Include region entities in the search (default).
1 - Exclude region entities in the search (default).
- Returns:
hwReturnStatus- Status objectHmQueryResult- Result object containing the output values:entityTypes (list of strings)
Examples#
Get all entities that cross-reference components with IDs 100-110 onoutputCollectionSetand highlight them on the screen#import hm import hm.entities as ent model = hm.Model() component_collection = hm.Collection(model,ent.Component,list(range(100,111))) out_col_set = hm.CollectionSet(model) _, result = model.hm_getcrossreferencedentities( collection=component_collection, reference_flag=7, outputCollectionSet=out_col_set ) print("Cross-referenced entities: ", result.entityTypes) for col in out_col_set: model.hm_highlightmark(collection=col, highlight="h")
Get only collected entity cross-references for components with IDs 100-110 onoutputCollectionSet#import hm import hm.entities as ent model = hm.Model() component_collection = hm.Collection(model,ent.Component,list(range(100,111))) out_col_set = hm.CollectionSet(model) _, result = model.hm_getcrossreferencedentities( collection=component_collection, reference_flag=1, outputCollectionSet=out_col_set ) print("Cross-referenced entities: ", result.entityTypes)
Get only data name entity cross-references for components with IDs 100-110 onoutputCollectionSet#import hm import hm.entities as ent model = hm.Model() component_collection = hm.Collection(model,ent.Component,list(range(100,111))) out_col_set = hm.CollectionSet(model) _, result = model.hm_getcrossreferencedentities( collection=component_collection, reference_flag=2, outputCollectionSet=out_col_set ) print("Cross-referenced entities: ", result.entityTypes)
Get only attribute entity cross-references for components with IDs 100-110 onoutputCollectionSet#import hm import hm.entities as ent model = hm.Model() component_collection = hm.Collection(model,ent.Component,list(range(100,111))) out_col_set = hm.CollectionSet(model) _, result = model.hm_getcrossreferencedentities( collection=component_collection, reference_flag=4, outputCollectionSet=out_col_set ) print("Cross-referenced entities: ", result.entityTypes)