Model.hm_comparegettransformationmatchcount#

Model.hm_comparegettransformationmatchcount(transformation_index)#

Returns the number of matches for a specific transformation. This must be preceded by a call to a relevant hm_compareentities function.

Parameters:

transformation_index (int) – The index of the transformation to query, starting with 0. The number of transformations can be found using Model.hm_comparegettransformationcount().

Returns:

Example#

Find the number of matches for transformation 0 for the recursive comparison of surfaces with IDs 1 - 20 and 101 - 120#
import hm
import hm.entities as ent

model = hm.Model()

surf1 = hm.Collection(model, ent.Surface, list(range(1, 21)))
surf2 = hm.Collection(model, ent.Surface, list(range(101, 121)))

model.hm_compareinit()

model.hm_compareentitiesrecursive(
    source_surfaces=surf1,
    target_surfaces=surf2,
    tolerance=0.1,
    result_type=2,
    review_results=False,
)

_, result = model.hm_comparegettransformationmatchcount(transformation_index=0)

num_matches = result.numberOfMatches
print("num_matches", num_matches)

model.hm_compareend()