Model.CE_ConnectorLineCreateWithRules#

Model.CE_ConnectorLineCreateWithRules(collection, density, spacing, half_spacing_offset, offset, 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 line entities that specify the location of the connectors.

  • density (unsigned int) – Integer number to split line into number of points. Spacing between points (=line_length/density).

  • spacing (double) – Float number to split line into number of points with specified distance between points (= spacing).

  • half_spacing_offset (unsigned int) –

    Create points from an offset (= spacing/2) from the start and end of line.

    0 - Follows the spacing provided by offset parameter

    1 - Follows the spacing in parameter description (half_spacing_offset)

  • offset (double) – Create points from an offset (= offset) from the start and end of line.

  • 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 has precedence during realization of connector. Applicable to components and surfaces only.

    0 - geometry

    1 - elements

  • 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) – Number of entities to add/update for a connector (connectors thickness (2T, 3T, etc.) value).

Example#

Create a connector at line with ID 1 with spacing of 2.0 and half_spacing_offset, and add nearest two of the four components with IDs 21, 23, 24 and 27 specified within a tolerance of 1.0. If the connector is realized, components must be connected through their elements rather than geometry. Remember the components by their IDs#
import hm
import hm.entities as ent

model = hm.Model()

model.CE_ConnectorLineCreateWithRules(
    collection=hm.Collection(model, ent.Line, [1]),
    density=0,
    spacing=2.0,
    half_spacing_offset=1,
    offset=0.0,
    entitycollection=hm.Collection(model, ent.Component, [21, 23, 24, 27]),
    ent_state=1,
    ce_rules=1,
    ce_le_rule=1,
    tol_flag=1,
    tolerance=1.0,
    num_ents=2,
)

Note

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