Model.create_tube_midline#
- Model.create_tube_midline(collection, copy_metadata=0, dest_comp='', tube_ends_collection=Collection(), dest_part='', dest_comp_prefix='Midline_')#
Creates midlines from tube solids.
The options can be specified in any order.
- Parameters:
collection (Collection) – The collection containing the input solid entities.
copy_metadata (int) –
This specifies whether the metadata is copied from the input solids to the appropriate midline:
0 - Do not copy
1 - Copy (default)
dest_comp (hwString) –
This specifies which component the midlines will be created in:
current - Creates all midlines in the current component.
original - Creates the midline for each solid in the same component as the solid itself. If the solid lies in several components, the midline will be created in one of these.
original.# - Creates the midline for each solid in the component with the original component name suffixed with 1., 2., and so on.
tube_ends_collection (Collection) – The collection containing the hint surfaces entities that constitute ends of the tube.
dest_part (hwString) –
This specifies which part the midlines will be created in:
current - Creates all midlines in the current part.
original - Creates the midline for each solid in the same part as the solid itself.
new - Creates the midline in the new part hierarchy.
dest_comp_prefix (hwString) – Prepends the created midline components with string value. (Default
dest_comp_prefix="Midline_")
Example#
Extract the midlines from solids with IDs 234 and 235 and place the result in the same components as the original solids#import hm import hm.entities as ent model = hm.Model() solidcollection = hm.Collection(model, ent.Solid, [234, 235]) model.create_tube_midline(collection=solidcollection, dest_comp="original")