Model.CE_ConnectorCreateWithRules#

Model.CE_ConnectorCreateWithRules(collection, entitycollection, ent_state, ce_rules, ce_le_rule, tol_flag, tolerance, num_ents)#

Creates connector(s) at the specified location(s) with defined rules.

Parameters:
  • collection (Collection) – The collection containing the entities to specify the location of the connectors. Valid entities are nodes and points.

  • entitycollection (Collection) – The collection containing the entities to be added to the connector as a link. Valid entities are nodes, elements, tags, surfaces and components.

  • ent_state (unsigned int) –

    Specifies whether geometry or FE gets precedence during realization of connector. Applicable to components and surfaces only.

    0 - geoms

    1 - elems

  • ce_rules (unsigned int) –

    Rule to specify if and how a link entity is to be added to a connector.

    0 - none

    1 - now

    2 - at fe realize

  • ce_le_rule (unsigned int) –

    Rule that specifies how an entity is to be remembered by the connector.

    0 - none

    1 - use ID

    2 - use name

  • tol_flag (unsigned int) –

    Specifies if tolerance value is applicable.

    0 - Use default.

    1 - Use specified value.

  • tolerance (double) – Specified to add entities only with in the given tolerance from the specified connector (same as search radius in fe realize panel).

  • num_ents (int) – Total number of entities to add/update connector (connectors thickness (2T, 3T, etc.) value).

Example#

Create a connector at point with ID 1 and add nearest 2 of the four components with IDs 21, 23, 24 and 27 specified within a tolerance of 1.0. Components need to be connected through elements in them and not geometry if connector is realized. Remember the components by their ID#
import hm
import hm.entities as ent

model = hm.Model

model.CE_ConnectorCreateWithRules(
    collection=hm.Collection(model, ent.Point, [1]),
    entitycollection=hm.Collection(model, ent.Component, [21, 23, 24, 27]),
    ce_rules=1,
    ce_le_rule=1,
    tol_flag=1,
    tolerance=1.0,
    num_ents=2,
)

Note

Created connector is displayed as a cylinder and only the closest two components are added to it. The total number of layers defined at the connector is 2.