Model.morphconstraintupdateavm#

Model.morphconstraintupdateavm(scollection, ecollection, type, mcon, target, bound, color)#

Updates a model type constraint for the elements on the mark with the option of having the area, volume, or mass forced to be greater than, less than, or equal to the specified value.

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

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

  • ecollection (Collection) – The collection containing the input element entities.

  • type (int) –

    0 - Area

    1 - Volume

    2 - Mass

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

  • target (double) – The constrained value for area, volume, or mass.

  • bound (int) –

    -1 - Greater than specified target

    0 - Equal to specified target

    1 - Less than specified target

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

Example#

Update a constraint with ID 5 where the area is specified to be exactly 3600.0 and the input shapes and elements are selected interactively by the user#
import hm
import hm.entities as ent

model = hm.Model()

model.morphconstraintupdateavm(
    scollection=hm.CollectionByInteractiveSelection(model, ent.Shape),
    ecollection=hm.CollectionByInteractiveSelection(model, ent.Element),
    type=0,
    mcon=ent.Morphconstraint(model, 5),
    target=3600.0,
    bound=0,
    color=32,
)