Model.hm_ce_tooclosetoedgecheck#

Model.hm_ce_tooclosetoedgecheck(collection1, collection2, distance, feature_angle, edge_option, auto_fix)#

Checks if connectors are too close to an edge.

If all connectors are ok then the HmQueryResultList that is returned is empty.

Parameters:
  • collection1 (Collection) – The collection containing the connector entities to check.

  • collection2 (Collection) – The collection containing the component entities to check.

  • distance (double) – The minimum distance to the edge.

  • feature_angle (double) – The feature angle to consider.

  • edge_option (int) –

    0 - Free edges

    1 - Both edges

    2 - Feature edges

  • auto_fix (int) –

    0 - Do not auto fix bad connectors

    1 - Auto fix bad connectors

Returns:

Example#

Check all connectors against components with IDs 2 and 3 , use a distance of 3.0#
import hm
import hm.entities as ent

model = hm.Model()

connector_collection = hm.Collection(model, ent.Connector)
comp_collection = hm.Collection(model, ent.Component, [2, 3])

_, resultlist = model.hm_ce_tooclosetoedgecheck(
    collection1=connector_collection,
    collection2=comp_collection,
    distance=3.0,
    feature_angle=0.3,
    edge_option=0,
    auto_fix=0,
)

for result in resultlist:
    print("Connector ID:", result.connector.id)
    for info in result.comp_info:
        print("Component ID:", info.component)
        print("Location:", info.location)
        for eleminfo in info.elem_info:
            print("Element ID:", eleminfo.element.id)
            print("Distance:", eleminfo.distance)