Model.autoupdate1delems#

Model.autoupdate1delems(collection, adjustoffset='', allshells=0, angletol=0.0, offsetends='', offsetlateral='', offsetnormal='', orient=0, rotate=0.0, thickness='')#

Updates the orientation and offset of 1D elements using the normal and thickness of neighboring shells. These shells are identified by the function itself. It works only with bar/beam elements.

Parameters:
  • collection (Collection) – The collection containing the input elements.

  • adjustoffset (hwString) –

    Flag to adjust offset in vertical (normal) and/or lateral direction. Valid values are:

    vert - Adjusts vertical offset

    lat - Adjusts lateral offset

    all - Adjusts both offsets

  • allshells (int) –

    Flag to consider all or displayed neighboring shells. Valid values are:

    0 - Only displayed shells

    1 - All shells

  • angletol (double) – The angular tolerance in degrees, used for orientation to check whether shell normal is within limit.

  • offsetends (hwString) –

    The flag to offset at both ends of the elements or any one. Valid values are:

    start - Offset at start/end a

    end - Offset at end/end b

    startend - Offset at both ends

  • offsetlateral (hwString) –

    The offset flag in lateral direction. Valid values are:

    neg - Negative

    pos - Positive

  • offsetnormal (hwString) –

    The offset flag in normal direction. Valid values are:

    neg - Negative

    pos - Positive

  • orient (int) –

    Flag to orient the elements. Valid values are:

    0 - False

    1 - True

  • rotate (double) – The rotation angle in degrees, for orientation. Elements are rotated along their respective x-axis.

  • thickness (hwString) –

    The mode of thickness to be considered for shell thickness, in case of multiple neighboring shells having different thickness values. Valid values are:

    avg - Averaged thickness

    max - Maximum thickness

    min - Minimum thickness

Examples#

Update orientation of selected 1D elements by 180 degrees to shell normal :#
import hm
import hm.entities as ent

model = hm.Model()

elem_col = hm.Collection(model, ent.Element, [1, 2, 3, 4])
model.autoupdate1delems(
    collection=elem_col,
    orient=1,
    rotate=180.0
)
Update offset of selected 1D elements at both ends in negative direction of base and positive direction of adjacent with respect to neighboring shells ( consider its average thickness )#
import hm
import hm.entities as ent

model = hm.Model()

elem_col = hm.Collection(model, ent.Element, [1, 2, 3, 4])
model.autoupdate1delems(
    collection=elem_col,
    rotate=180.0,
    thickness="avg",
    offsetnormal="neg",
    offsetlateral="pos",
    adjustoffset="all",
    offsetends="startend",
)