Groups parts into partsets based on matching shapes.
Syntax
*group_matches
entity_type mark_id reference_entity_type reference_mark_id string_array
number_of_strings
Type
HyperMesh Tcl Modify Command
Description
Groups parts into partsets based on matching shapes.
Similar shapes are grouped into to a single partset. A parent partset is created for all
different partsets. Unmatched partsets can optionally be put in a new partset. Also see
hm_getmatching to find and group but not create partsets.
Inputs
- entity_type
- The type of entity to group. Must be set as modules/parts.
- mark_id
- The ID of the mark containing the entities to group. Valid values are 1 and 2.
- reference_entity_type
- The type of entity to use as reference. Must be set as modules/parts.
- reference_mark_id
- The ID of the mark containing the reference entities, if any. Valid values are 1 and
2. If the mark is empty, grouping is done by finding similar shapes within all input
entities.
- string_array
- The string array ID that contains the additional input parameters. The string array is
created using the *createstringarray command. This should always be
set to 1.
- Strings are indicated using the format "name=value". Valid strings are:
- areaCalcMethod=<value>
- Specifies how the matching area percentage is calculated when
searchMethod=ByArea:
- ByLowestId - Calculate with respect to the entity with the lowest ID
(default)
- ByHighestId - Calculate with respect to the entity with the highest ID
- compareType=<value>
- Specifies with what entities the comparison happens when
searchMethod=ByEncoding:
- 0 - Use both CAD and FE from the input selection
- 1 - Prefer CAD over FE. This will pick FE only if the input has only FE.
- 2 - Use only CAD
- 3 - Prefer FE over CAD. This will pick CAD only if the input has only CAD.
- 4 - Use only FE
- deformationTolerance=<value>
- The tolerance value to check matching. Valid for
searchMethod=ByArea and
searchMethod=ByTopo. Default is the global node
tolerance.
- encoding_algorithm=<value>
- The optional encoding algorithm to use when
searchMethod=ByEncoding. Valid values are:
- 0 - Spherical harmonics (default)
- matchingPercentThreshold=<value>
- The matching area threshold above which matching pairs are returned (default is
node tolerance).
- When searchMethod=ByEncoding, this is reported as (1 –
differenceinencoding/deformationTolerance=<value>)
- parentpartsetname=<value>
- The name for the parent partset. This can have format strings for substituting
searchMethod, matchingPercentThreshold and deformationTolerance. Default is
"%searchMethod_%matchingPercentThreshold_%deformationTolerance". When the command
is rerun with the same settings, part sets can get overwritten if the same
parentpartsetname is provided.
- partsetname=<value>
- The name for the partset containing matching parts. This can have format strings
for introducing representative part names. Default "Matched_%partname" will
substitute %partname with the representative (among matches in the group) part
name of the group. When the partset is created the name will also have the parent
partset ID at the end regardless of the name given here. When the command is rerun
with the same settings, part sets can get overwritten if the same
partsetname is provided.
- partsetforunmatched=<value>
- If set to 1, creates a separate partset for unmatched parts. Default 0.
- searchMethod=<value>
- The method to perform the comparison:
- ByArea - Use area of entities (default)
- ByEncoding - Use shape encoding
- ByTopo - Use topology comparison
- sphai:sphhar_bandwidth=<value>
- Optional, valid for encoding_algorithm 0, default 16.
- sphai:sphhar_fallof=<value>
- Optional, valid for encoding_algorithm 0, default
2.828427.
- sphai:sphhar_radii=<value>
- Optional, valid for encoding_algorithm 0, default 32.
- sphai:resolution=<value>
- Optional, valid for encoding_algorithm 0, default 64.
- unmatchedpartsetname=<value>
- The name for the unmatched partset when
partsetforunmatched=1.
- number_of_strings
- Integer indicating the size (number of strings) in the string array created using
*createstringarray.
Examples
To group all parts by area without any
reference:
*createmark parts 1 all
*createmark parts 2
*group_matches parts 1 parts 2
To group all parts by area using part 232 as the
reference:
*createmark parts 1 all
*createmark parts 2 232
*group_matches parts 1 parts 2
To group all parts by shape without any reference, using a custom parent partset
name:
*createmark parts 1 all
*createmark parts 2
*createstringarray 1 "method=Shape parentpartsetname=%searchMethod_%deformationTolerance"
*group_matches parts 1 parts 2 1 1
Errors
Incorrect usage results in a
Tcl error. To detect
errors, you can use the
catch
command:
if { [ catch {command_name...} ] } {
# Handle error
}