Model.morphconstraintupdateangle#

Model.morphconstraintupdateangle(scollection, type, mcon, n1, n2, n3, vec, angle, bound, color)#

Updates a model type constraint based on the angle between three nodes.

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

  • type (int) –

    0 - Measure angle node to node

    1 - Measure angle using vector

  • mcon (Entity) – The morph constraint entity

  • n1 (Entity) – The node of the first end of angle

  • n2 (Entity) – The node of the vertex of angle

  • n3 (Entity) – The node of the second end of angle

  • vec (hwTriple) – The hwTriple object defining the vector. User can also supply a Python list of three doubles.

  • angle (double) – Constrained angle

  • bound (int) –

    -1 - Greater than specified angle

    0 - Equal to specified angle

    1 - Less than specified angle

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

Example#

Update the model type constraint for the three selected nodes with IDs 21 , 22 , 23 with the option of update those nodes to be measured in the plane that they lie in and with the option of have the angle forced to be equal to the specified angle .#
import hm
import hm.entities as ent

model = hm.Model()

model.morphconstraintupdateangle(
    scollection=hm.CollectionByInteractiveSelection(model, ent.Shape),
    type=0,
    mcon=ent.Morphconstraint(model, 5),
    n1=ent.Node(model, 21),
    n2=ent.Node(model, 22),
    n3=ent.Node(model, 23),
    vec=[1.0, 0.0, 0.0],
    angle=45.0,
    bound=0,
    color=32,
)

Note

The shapes on the collection will be used to force the model into compliance with the specified constraint, if possible.