hm_holedetectionfindmates

Executes the hole/tube mating tools.

Syntax

hm_holedetectionfindmates ?parameter1=<>? ?parameter2=<>? etc

Type

HyperMesh Tcl Query

Description

Runs the hole detection mating functions for finding holes and tubes mating 'groups'. This must be preceded by a call to hm_holedetectionfindholes.

All other parameters are optional and have default values. Parameters can be specified in any order.

Inputs

max_angle
The maximum angle between the center line of holes/tubes. Default value 1.0.
max_distance
The maximum normal distance between the center of holes/tubes. Default value 10.0.
max_lateral_distance
The maximum lateral distance to allow. Default value 1.0.
max_lateral_factor
The maximum lateral distance to allow, defined by scaling the diameter of the current hole using this factor. This is not used by default and must be explicitly defined. This is ignored if max_lateral_distance is also defined.
allow_hole_to_tube
0 – Do not allow mates to be found between holes and tubes (default)
1 – Allow mates to be found between holes and tubes
allow_mismatched_shapes
0 – Do not allow mates to be found between different shapes (default)
1 – Allow mates to be found between different shapes
allow_self
0 – Do not allow mates to be found within the same component (default)
1 – Allow mates to be found within the same component

Example

To write out all geometric shell mate details to a file named C:/temp/holes.txt:

set holesfile [open "C:/temp/holes.txt" "w"]
hm_holedetectioninit
*createmark surfs 1 all
hm_holedetectionsetentities surfs 1
hm_holedetectionsetholeparams hole_shape=31 
hm_holedetectionfindholes 1
hm_holedetectionfindmates
set n [hm_holedetectiongetnumberofmates]
if { $n > 0 } {
puts $holesfile "Number of mates = $n"
puts $holesfile "Mate details"
for {set i 0} {$i < $n} {incr i} {
puts $holesfile "i = $i [hm_holedetectiongetmatedetails $i]"
}
} else {
puts $holesfile "Holes mates not detected."
}
hm_holedetectionend
close $holesfile

Errors

Incorrect usage results in a Tcl error. To detect errors, you can use the catch command:
if { [ catch {command_name...} ] } {
   # Handle error
}

Version History

14.0