Model.setply#

Model.setply(collection, ply_number, only_orient, normal_size, color)#

Sets the ply number to review. The element ply direction of that ply will be plotted for each selected element with respect to the element (material) orientation. When review is complete, the function Model.vectorsoff() must be run.

Parameters:
  • collection (Collection) – The collection containing the entities to review. Valid entities are elements and properties.

  • ply_number (int) – The number of the ID of the ply to review.

  • 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.

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

Example#

Review the ply directions for the ply with ID 2 for the displayed elements with blue vectors of size 3.0#
import hm
import hm.entities as ent

model = hm.Model()

model.setply(
    collection=hm.CollectionByDisplayed(model, ent.Element),
    ply_number=2,
    only_orient=1,
    normal_size=3.0,
    color=7,
)
model.vectorsoff()