Model.morphconstraintupdatelength#

Model.morphconstraintupdatelength(scollection, type, mcon, nodes, vec, length, bound, color)#

Updates a model type constraint based on the length of a list of nodes.

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

  • type (int) –

    0 - Measure length node to node

    1 - Measure length using vector

  • mcon (Entity) – The morph constraint entity to update.

  • nodes (EntityList) – The list of node entities.

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

  • length (double) – Constrained length of node list.

  • bound (int) –

    -1 - Greater than specified length

    0 - Equal to specified length

    1 - Less than specified length

  • color (int) – Color (1 through 64 inclusive).

Example#

Update a model type constraint for the selected node list with the option of update those nodes to be measured node to node or along a vector and the option of update the node list to be forced to be greater than , less than , or equal to the specified length#
import hm
import hm.entities as ent

model = hm.Model()

model.morphconstraintupdatelength(
scollection=hm.Collection(model, ent.Shape, [1]),
type=0,
mcon=ent.Morphconstraint(model, 5),
nodes=[ent.Node(model, 1), ent.Node(model, 2), ent.Node(model, 3)],
vec=[1.0, 0.0, 0.0],
length=43.5,
bound=0,
color=32,
)

Note

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