Model.midsurfaceextract#
- Model.midsurfaceextract(collection, mode, thickness_bound, min_thickness, max_thickness, reserved_2, reserved_3, new_or_curr_comp)#
Extracts a midsurface from a pair of two surfaces.
Previously, this function was also used to extract a midsurface from a solid or from multiple surfaces. The function will still work in that manner for backwards compatibility but the function
Model.midsurface_extract_10()is now recommended for those situations. The options listed below are the currently recommended options.- Parameters:
collection (Collection) – The collection containing the entities.
mode (int) –
1 - Surface pair without “combine with adjacent plates” and “combine all adjacent plates” options.
2 - Surface pair with “combine with adjacent plates” and without “combine all adjacent plates” options.
3 - Surface pair with “combine with adjacent plates” and “combine all adjacent plates” options.
thickness_bound (int) – Not required for surface pair extraction. Value = 0.
min_thickness (double) – Not required for surface pair extraction. Value = 0.
max_thickness (double) – Not required for surface pair extraction. Value = 0.
reserved_2 (Collection) – Reserved for future development. Set it as empty collection.
reserved_3 (int) – Reserved for future development. Value = 0.
new_or_curr_comp (int) –
0 - Midsurface will be created in the current component.
1 - Midsurface will be created in a new component named middle surface.
Example#
Extract the midsurface between surfaces 10 and 15 use the “ combine with adjacent plates “ and “ combine all adjacent plates “ options and organize them into the “ middle surface “ component#import hm import hm.entities as ent model = hm.Model() surface_collection = hm.Collection(model, ent.Surface, [10, 15]) model.midsurfaceextract( collection=surface_collection, mode=3, thickness_bound=0, min_thickness=0, max_thickness=0, reserved_2=hm.Collection(model, ent.Component, populate=False), reserved_3=0, new_or_curr_comp=1, )