Model.align1delemsbysystem#

Model.align1delemsbysystem(collection=Collection(), align='', angle=0.0, angledeviation=0.0, dimension='', system=0, xcomp=0.0, ycomp=0.0, zcomp=0.0)#

Aligns 1D elements with respect to global or local system.

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

  • align (hwString) –

    The axis of the system with respect to which the elements will be aligned. User can directly supply a Python string. Valid values are:

    x or r - X axis

    y or t - Y axis

    z or p - Z axis

    xy or rt - XY axis

    yz or tp - YZ axis

    xz or rp - XZ axis

    all or xyz or rtz or rtp - All axes

    vec - Uses vector components to define the alignment

  • angle (double) – The angular tolerance while aligning elements with respect to the axis of the input system.

  • angledeviation (double) – The angular tolerance to consider a particular axis for aligning.

  • dimension (hwString) – The dimension of the elements to consider. Valid value is 1D. User can directly supply a Python string.

  • system (int) – The reference system ID. If set to 0, the global system is used.

  • xcomp (double) – The x component of the vector when align="vec".

  • ycomp (double) – The y component of the vector when align="vec".

  • zcomp (double) – The z component of the vector when align="vec".

Examples#

Align selected 1D elements with respect to local system with ID 1, along all its axes#
import hm
import hm.entities as ent

model = hm.Model()
elems = hm.Collection(model,ent.Element,[1,2,3,4])
model.align1delemsbysystem(
    collection=elems,
    dimension="1D",
    system=1,
    angle=15.0,
    align="xyz"
)
Align selected 1D elements using vector components (1,0,0)#
import hm
import hm.entities as ent

model = hm.Model()
comps = hm.Collection(model,ent.Component,[1,2,3])
model.align1delemsbysystem(
    collection=elems,
    dimension="1D",
    angledeviation=15.0,
    align="vec",
    xcomp=1.0,
    ycomp=0.0,
    zcomp=0.0
)