Model.hm_gettiedentities#
- Model.hm_gettiedentities(input_collection, output_collection, projection=1)#
Finds elements or components tied to nodes, elements, components or contactsurfs.
- Parameters:
input_collection (Collection) – The collection containing the input entities. Valid entities are nodes, elements, components or contactsurfs.
output_collection (Collection) – The collection containing the entities to find/output. Valid entities are elements and components.
projection (int) –
0 - Do not compute the projection while getting the tied entities
1 - Compute the projection while getting the tied entities (default)
- Returns:
hwReturnStatus- Status object
Examples#
Find and show elements tied to the displayed elements#import hm import hm.entities as ent model = hm.Model() element_collection = hm.CollectionByDisplayed(model, ent.Element) tied_entities_collection = hm.Collection(model, ent.Element, populate=False) # Finding tied entities model.hm_gettiedentities( input_collection=element_collection, output_collection=tied_entities_collection ) # Showing tied entities if found if len(tied_entities_collection) > 0: collection_set = hm.CollectionSet(model) collection_set.set(tied_entities_collection) model.showentitybymark(collection_set=collection_set)
Find and show elements tied to component with ID 1#import hm import hm.entities as ent model = hm.Model() component_collection = hm.Collection(model, ent.Component, [1]) tied_entities_collection = hm.Collection(model, ent.Element, populate=False) # Finding tied entities model.hm_gettiedentities( input_collection=component_collection, output_collection=tied_entities_collection ) # Showing tied entities if found if len(tied_entities_collection) > 0: collection_set = hm.CollectionSet(model) collection_set.set(tied_entities_collection) model.showentitybymark(collection_set=collection_set)
Find and show components tied to component with ID 3#import hm import hm.entities as ent model = hm.Model() component_collection = hm.Collection(model, ent.Component, [3]) tied_entities_collection = hm.Collection(model, ent.Component, populate=False) # Finding tied entities model.hm_gettiedentities( input_collection=component_collection, output_collection=tied_entities_collection ) # Showing tied entities if found if len(tied_entities_collection) > 0: collection_set = hm.CollectionSet(model) collection_set.set(tied_entities_collection) model.showentitybymark(collection_set=collection_set)