Model.morphhandlepertxyz#

Model.morphhandlepertxyz(collection, x_val, y_val, z_val, system_id, symmetry_flag, constraint_flag)#

All handles on the collection will be given a perturbation equal to the x, y, and z values for the given system. If symmetry is used, all handles linked to handles on the colleciton by symmetry will also be perturbed. If constraints are used they will be applied to the perturbations.

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

  • x_val (double) – The X value of the perturbation.

  • y_val (double) – The Y value of the perturbation.

  • z_val (double) – The Z value of the perturbation.

  • system_id (int) – ID of the coordinate system used to determine perturbation direction. To use the global system, set this value to 0.

  • symmetry_flag (int) –

    0 - Do not use symmetry links.

    1 - Use symmetry links

  • constraint_flag (int) –

    0 - Do not use constraints, perform auto qa

    1 - Use constraints, perform auto qa

    2 - Do not use constraints, do not perform auto qa

    3 - Use constraints, do not perform auto qa

Example#

Perturb the handles with IDs 1,2,3,4 by 2.0 in the x direction , 1.0 in the y direction , and 0.1 in the z direction use the global system#
import hm
import hm.entities as ent

model = hm.Model()

model.morphhandlepertxyz(
    collection=hm.Collection(model, ent.Handle, [1, 2, 3, 4]),
    x_val=2.0,
    y_val=1.0,
    z_val=0.1,
    system_id=0,
    symmetry_flag=1,
    constraint_flag=1,
)