Model.CE_AutoCreateMatingConnectors#
- Model.CE_AutoCreateMatingConnectors(collection, Allow_Hole_to_Tube=False, Allow_mismatched_shapes=True, Allow_Self=False, Center_CE=False, Hole_Type=7, Lateral_Distance=True, Max_Angle=1, Max_dia=10, Max_Distance=10, Max_lateral_factor=0, Min_dia=0, Lateral_Factor=False, Max_lateral_distance=1)#
Identifies the mating holes in selected components or parts and creates a connector at the specified locations of the mating holes.
- Parameters:
collection (Collection) – The collection containing the input entities. Valid entity types are components and parts.
Allow_Hole_to_Tube (bool) – Allows identifying tube hole mates. Valid values are True and False.
Allow_mismatched_shapes (bool) – Allows identifying mismatched holes. Valid values are True (default) and False.
Allow_Self (bool) – Allows identifying mating holes within the same part/component. Valid values are True and False.
Center_CE (bool) – Allows the connector to be created at the center of the two mating holes. Valid values are True and False.
Hole_Type (unsigned int) –
The type of the hole to be identified as the mating hole.
1 - General
2 - Circular
4 - Rounded
7 - All
8 - Square
16 - Rectangular
Lateral_Distance (bool) – The lateral distance (default true).
Max_Angle (double) – The maximum lateral angle within which the mating holes should be identified.
Max_dia (double) – The maximum diameter of the hole considered for hole identification.
Max_Distance (double) – The range within which the mating holes should be identified.
Max_lateral_factor (double) – The maximum lateral factor (default 0).
Min_dia (double) – The minimum diameter of the hole considered for hole identification.
Lateral_Factor (bool) – Option to consider max lateral factor. Supported values are true and false. Effective only if
Lateral_Distance=False.Max_lateral_distance (double) – The maximum allowed lateral distance (default 1.0).
Example#
Identify mating holes and create connectors between the displayed parts at the identified locations#import hm import hm.entities as ent model = hm.Model() model.CE_AutoCreateMatingConnectors( collection=hm.CollectionByDisplayed(model, ent.Part), Allow_Hole_to_Tube=False, Allow_mismatched_shapes=True, Allow_Self=False, Center_CE=False, Hole_Type=7, Lateral_Distance=True, Max_Angle=5.0, Max_dia=20.0, Max_Distance=10.0, Max_lateral_factor=0.0, Min_dia=0.0, Lateral_Factor=False, Max_lateral_distance=0.874886635, )