Model.setglobalply#

Model.setglobalply(collection, ply_name, only_orient, normal_size, color)#

Sets the ply name 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_name (hwString) – The name 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 through 64.

Example#

Review the ply directions for the second ply named “ply45” for the displayed elements with blue vectors of size 3.0#
import hm
import hm.entities as ent

model = hm.Model()

model.setglobalply(
    collection=hm.CollectionByDisplayed(model, ent.Element),
    ply_name="ply45",
    only_orient=1,
    normal_size=3.0,
    color=7,
)
model.vectorsoff()