Model.assignsystem#

Model.assignsystem(collection, system_entity, axis, only_orient, normal_size, color)#

References a coordinate system to an element. The specified axis of this system is then projected on the element plane. Re-orients and visualizes the element (material) coordinate system for selected elements. When review is complete, the function Model.vectorsoff() must be run.

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

  • system_entity (Entity) – The object describing the system entity to project onto the element plane. A value of system_entity=None indicates the global axes.

  • axis (int) –

    Determines the selected axis of the coordinate system to be projected. This axis is projected onto the element plane to define the element orientation. Angle \(\theta\) is determined from the new x-element direction and the element normal, and then saved. The new x-element direction is visualized. Valid options are:

    -1 - The system_entity is saved and the first axis is used for projection and visualization.

    0 - First axis.

    1 - Second axis.

    2 - Third axis.

  • only_orient (int) –

    0 - The new x-element directions are shown as continuous gradient lines starting and ending on free edges.

    1 - The new x-element directions are displayed as vectors starting from the element centroid.

  • normal_size (double) – If only_orient=1, this defines the size of the displayed vectors. If set to 0, the size will be determined automatically.

  • color (int) – The color of the vectors or lines. Valid values are 1 through 64.

Examples#

Project the z - axis of the global coordinate system (system_entity = None ) on the element plane of four selected elements and display the projection as blue vectors (color=7 ) with normal_size=3.0#
import hm
import hm.entities as ent

model = hm.Model()

elem_col = hm.Collection(model, ent.Element, [376, 377, 389, 418])

model.assignsystem_option(
    collection=elem_col,
    system_entity=None,
    axis=2,
    only_orient=1,
    normal_size=3.0,
    color=7,
)
model.vectorsoff()
Project the local coordinate system ( with ID 1 ) on the element plane of those elements and display the projection as green lines (color=7 )#
import hm
import hm.entities as ent

model = hm.Model()

elem_col = hm.Collection(model, ent.Element, [376, 377, 389, 418])

model.assignsystem_option(
    collection=elem_col,
    system_entity=ent.System(model, 1),
    axis=-1,
    only_orient=0,
    normal_size=0.0,
    color=10,
)
model.vectorsoff()