Model.CE_AddLinkEntitiesWithArrays#

Model.CE_AddLinkEntitiesWithArrays(integer_array, entity_collection, entity_state, ce_rules, ce_le_rule, tolerance_flag, double_array, keep_existing, ce_spot_extralinknum=0, ce_seam_extralinknum=0, ce_spot_non_normal=0, ce_area_non_normal=0, prefer_diff_links_per_layer=0)#

Updates connectors at the specified locations with arrays.

Parameters:
  • integer_array (hwIntList) – The list of integers that contains the connector ID and number of layers for that connector.

  • entity_collection (Collection) – The collection containing the entities to use as links.

  • entity_state (unsigned int) –

    The state of the link entities. Valid values are:

    0 - Geometry.

    1 - Elements.

  • ce_rules (unsigned int) –

    Flag indicating when to make the links. Valid values are:

    0 - Now.

    1 - At realize.

  • ce_le_rule (unsigned int) –

    Flag indicating how to make the links. Valid values are:

    0 - None.

    1 - Use ID.

    2 - Use name.

  • tolerance_flag (unsigned int) –

    Flag indicating whether to use the default tolerance. Valid values are:

    0 - Use default.

    1 - Use specified values.

  • double_array (hwDoubleList) –

    The list contains the add link tolerance values.

    The tolerance is used to add entities only within the given value from the specified connector. Must be set to 1. Ignored if tolerance_flag=0.

  • keep_existing (unsigned int) –

    Option for deleting existing links first then adding new links, or adding new links directly.

    0 - Delete then add.

    1 - Add.

  • ce_spot_extralinknum (unsigned int) – The number of extra links for spot connectors.

  • ce_seam_extralinknum (unsigned int) – The number of extra links for seam connectors.

  • ce_spot_non_normal (int) – The non-normal option for spot connectors.

  • ce_area_non_normal (int) – The non-normal option for area connectors.

  • prefer_diff_links_per_layer (unsigned int) – Reserved for future development

Example#

Add components with IDs 1 and 2 to connectors with IDs 1001, 1002, and 1003 from scratch, the layer numbers for these connectors are 2, 3, and 2, the tolerances are 10.0, 11.0, and 15.0#
import hm
import hm.entities as ent

model = hm.Model()

model.CE_AddLinkEntitiesWithArrays(
    integer_array=[1001, 2, 1002, 3, 1003, 2],
    entity_collection=hm.Collection(model, ent.Component, [1, 2]),
    entity_state=1,
    ce_rules=1,
    ce_le_rule=0,
    tolerance_flag=0,
    double_array=[10.0, 11.0, 15.0],
    keep_existing=0,
    ce_spot_extralinknum=5,
    ce_seam_extralinknum=7,
    ce_area_non_normal=0,
)