Model.hm_getclosedshelllayerelems#
- Model.hm_getclosedshelllayerelems(collection, layer_1_collection, layer_2_collection)#
Separates top and bottom layer elements of thin closed-shell solids and puts elements of respective layers on element
layer_1_collectionandlayer_2_collection. The function expects each solid to be contained in a single component, i.e., any input solid should not be spread across multiple components. This function is slightly tolerant towards imperfectly closed shells and therefore the input need not be completely watertight.- Parameters:
collection (Collection) – The collection containing the input component entities.
layer_1_collection (Collection) – The collection containing the element entities of top layer.
layer_2_collection (Collection) – The collection containing the element entities of bottom layer.
- Returns:
hwReturnStatus- Status object
Example#
Get the top and bottom layers for components with IDs 54 and 55#import hm import hm.entities as ent model = hm.Model() component_collection = hm.Collection(model, ent.Component, [53, 54]) top_layer_collection = hm.Collection(model, ent.Element, populate=False) bottom_layer_collection = hm.Collection(model, ent.Element, populate=False) _ = model.hm_getclosedshelllayerelems( collection=component_collection, layer_1_collection=top_layer_collection, layer_2_collection=bottom_layer_collection, ) print(len(top_layer_collection), [el.id for el in top_layer_collection]) print(len(bottom_layer_collection), [el.id for el in bottom_layer_collection])