Model.findandremovethreads#

Model.findandremovethreads(collection, max_depth, replacement_type, flags, reserved1, reserved2)#

Tries to recognize threads with a depth less than the specified maximum value, then replaces the recognized threads with simple smooth surfaces (usually a combination of cylinders, cones, and smooth NURBS surfaces); recognition and removal are performed within a given selection of surfaces or solids, and optionally, the input selection can be considered as a seed selection, allowing attached surfaces to also become involved in the process.

Parameters:
  • collection (Collection) – The collection containing the entities to find threads in. Valid values are Surfaces and Solids.

  • max_depth (double) – The maximum depth of threads to find and remove.

  • replacement_type (int) –

    The type of major cylinder surface to use for replacing the thread:

    -2 - Autodecide (by minor diameter for holes, by major diameter for bolts).

    -1 - Replacement by minor diameter.

    0 - Replacement by mean diameter.

    1 - Replacement by major diameter.

  • flags (int) –

    Flags controlling the mode of thread removal.

    Bit values are used and the value is calculated as (Bit0). Valid Bit values are:

    Bit0

    Surfaces considered. Valid values are:

    0 - Attached surfaces can also be considered, with input surfaces used as seeds.

    1 - Only surfaces specified as input can be considered

  • reserved1 (double) – Reserved for future use. Value must be 0.0.

  • reserved2 (double) – Reserved for future use. Value must be 0.0.

Example#

Recognize and remove cylindrical threads with a depth less than 5.0 for a given surface selection considered as a seed selection, with auto replacement#
import hm
import hm.entities as ent

model = hm.Model()

model.findandremovethreads(
    collection=hm.Collection(model, ent.Surface, [1583, 1234]),
    max_depth=5.0,
    replacement_type=-2,
    flags=0,
    reserved1=0.0,
    reserved2=0.0
)