Model.hm_comparegetdistanceentitytype#

Model.hm_comparegetdistanceentitytype(distance_index)#

Returns the entity type for a specific distance index. This must be preceded by a call to a relevant hm_compareentities function and Model.hm_comparefinddistances().

Parameters:

distance_index (int) – The index of the distance to query, starting with 0. The number of distances can be found using Model.hm_comparegetdistancecount().

Returns:

Example#

Find the entity ID for distance index 0 for the recursive comparison of surfs 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,
)

model.hm_comparefinddistances(max_distance=1.0, review_results=True)

_, result = model.hm_comparegetdistanceentitytype(distance_index=0)

entity_type = result.entityType
print("entity_type", entity_type)

model.hm_compareend()