Model.hm_collisionwriteresultsfile#

Model.hm_collisionwriteresultsfile(filename, include_ignored=False)#

Writes the current collision results to a file. This must be preceded by a call to relevant hm_collision functions to generate the collision data. In addition, the pair_results flag to hm_collisioncheck() must be set to True.

Parameters:
  • filename (hwString) – The full name and path of the file to write the results to.

  • include_ignored (bool) –

    Specifies if results ignored when the allowable_depth value is specified via Model.hm_collisioninit() should be reported or not:

    0 - Do not include ignored results (default).

    1 - Include ignored results.

    Add a value of 10 to each of these to append to an existing file. By default, the file is overwritten.

Returns:

Example#

Find intersect surfaces from IDs 1 - 10 and write the results to the file * C:/collision.txt *#
import hm
import hm.entities as ent

model = hm.Model()

checking_surfs = hm.Collection(model, ent.Surface, list(range(1, 11)))
intersect_surfs = hm.Collection(model, ent.Surface, populate=False)


model.hm_collisioninit()
model.hm_collisionentitycreate(
    collection=checking_surfs,
    dimension=0,
    thickness_type=1,
    thickness=0,
    edge_penetration=0,
    midside_nodes=0,
    split_quads=0,
    used_topology=0,
    grouping_identifier=False,
    offset=0,
)
model.hm_collisioncheck(intersected_surfaces=intersect_surfs, pair_result=True)
model.hm_collisionwriteresultsfile(filename="C:/collision.txt")
model.hm_collisionend()