Model.hm_compareentitiesposition#

Model.hm_compareentitiesposition(source_entities, target_entities, tolerance, n1_source, n2_source, n3_source, n1_target, n2_target, n3_target, result_type=1, review_results=True)#

Generates comparison results for entities positioned at a specific location. This must be preceded by a call to Model.hm_compareinit().

These results can then be queried using hm_compareget APIs, or written to a file using hm_comparewrite APIs.

Parameters:
  • source_entities (Collection) – The collection containing the source entities. Valid entities are surfaces or elements.

  • target_entities (Collection) – The collection containing the target entities. Valid entities are surfaces or elements.

  • tolerance (double) – The tolerance value to use for the comparison.

  • n1_source (Entity) – The object describing the node entity of the source entity base (N1).

  • n2_source (Entity) – The object describing the node entity of the source entity x-direction (N2).

  • n3_source (Entity) – The object describing the node entity of the source entity xy-plane (N3).

  • n1_target (Entity) – The object describing the node entity of the target entity base (N1).

  • n2_target (Entity) – The object describing the node entity of the target entity x-direction (N2).

  • n3_target (Entity) – The object describing the node entity of the target entity xy-plane (N3).

  • result_type (int) –

    SURFS to SURFS

    SURFS to ELEMS

    ELEMS to SURFS

    ELEMS to ELEMS

    0 - Basic

    Matched (paired)

    Unmatched

    Matched (paired)

    Unmatched

    Matched

    Unmatched

    1 - Full (default)

    Matched (paired)

    Overlapped

    Intersected

    Unmatched

    Matched (paired)

    Overlapped

    Intersected

    Unmatched

    Matched

    Overlapped

    Intersected

    Unmatched

    2 - Detailed

    Matched (paired)

    Overlapped (paired)

    Intersected (paired)

    Unmatched

    Matched (paired)

    Overlapped (paired)

    Intersected (paired)

    Unmatched

    Matched

    Overlapped (paired)

    Intersected (paired)

    Unmatched

  • review_results (bool) –

    False - Do not automatically show the graphical comparison results after execution.

    True - Automatically show the graphical comparison results after execution (default). This is cleared upon a call to hm_compareend.

Returns:

Example#

Write the detailed comparison results file to “ C:/temp / my_compare.txt “ for the comparison of surfs with IDs 1 - 20 and 101 - 120 with source N1 / N2 / N3 nodes with IDs 100/101/102 and target N1 / N2 / N3 nodes with IDs 200/201/202#
import hm
import hm.entities as ent

model = hm.Model()

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

model.hm_compareinit()

model.hm_compareentitiesposition(
    source_entities=surfs1,
    target_entities=surfs2,
    tolerance=0.1,
    n1_source=ent.Node(model, 100),
    n2_source=ent.Node(model, 101),
    n3_source=ent.Node(model, 102),
    n1_target=ent.Node(model, 200),
    n2_target=ent.Node(model, 201),
    n3_target=ent.Node(model, 202),
    result_type=2,
    review_results=False,
)

model.hm_comparewriteresults(
    filename="C:/temp/my_compare.txt", source_component_id=0, target_component_id=0
)

model.hm_compareend()