Model.barelementcreatewithoffsets#

Model.barelementcreatewithoffsets(node1, node2, vector, orientation_node, y_dir, pin_flags_a, pin_flags_b, property_name, offset_system_a, offset_x_a, offset, y_a, offset_z_a, offset_system_b, offset_x_b, offset_y_b)#

Creates a bar element with offsets.

Parameters:
  • node1 (Entity) – The first node ID (end a).

  • node2 (Entity) – The second node ID (end b).

  • vector (hwTriple) – The hwTriple object defining the vector components. User can also supply a Python list of three doubles.

  • orientation_node (Entity) – The orientation node ID. If set to None, then vector is used. If non-zero, then y_dir specifies whether this node defines the local y- or local z-axis.

  • y_dir (int) – If set to 1, then orientation_node defines the local y-axis of the bar. Otherwise, orientation_node defines the local z-axis.

  • pin_flags_a (hwBoolList) – The pin flags at end a. A pin flag of None passes forces in all degrees of freedom.

  • pin_flags_b (hwBoolList) – The pin flags at end b. A pin flag of None passes force in all degrees of freedom.

  • property_name (hwString) – The name of the property collector assigned to the bar.

  • offset_system_a (int) –

    The system used to define the offsets at end a. Valid values are:

    0 - Offsets given in global coordinate system.

    1 - Offsets given in local coordinate system of node1.

    2 - Offsets given in elemental coordinate system.

  • offset_x_a (double) – The offset in the x-direction at end a.

  • offset_y_a (double) – The offset in the y-direction at end a.

  • offset_z_a (double) – The offset in the z-direction at end a.

  • offset_system_b (int) –

    The system used to define the offsets at end b. Valid values are:

    0 - Offsets given in global coordinate system.

    1 - Offsets given in local coordinate system of node1.

    2 - Offsets given in elemental coordinate system.

  • offset_x_b (double) – The offset in the x-direction at end b.

  • offset_y_b (double) – The offset in the y-direction at end b.

  • offset_z_b (double) – The offset in the z-direction at end b.

Example#

Create a bar3 element between nodes with IDs 101, 102 and 103 with its local y-axis defined by the vector (1, 0, and 0) and assigned property “prop1”. The element has an offset vector at end a defined using the global system (0.2, 0.2, and 0.2) and offset vector at end b defined using the global system (0.3, 0.3, and 0.3)#
import hm
import hm.entities as ent

model = hm.Model()

model.barelementcreatewithoffsets(
    node1=ent.Node(model, 101),
    node2=ent.Node(model, 102),
    vector=(1, 0, 0),
    orientation_node=None,
    y_dir=0,
    pin_flags_a=None,
    pin_flags_b=None,
    property_name="prop1",
    offset_system_a=0,
    offset_x_a=0.2,
    offset_y_a=0.2,
    offset_z_a=0.2,
    offset_system_b=0,
    offset_x_b=0.3,
    offset_y_b=0.3,
    offset_z_b=0.3
)