Model.mechcontructfromedi#

Model.mechcontructfromedi(mode, param)#

Creates objects needed for solving enabled mechanisms, such as applying positions or moving bodies.

The mechanism must have the enabled flag set to true for this to be possible.

Parameters:
  • mode (int) –

    The mode for mechanism operations:

    0 - Move

    2 - Apply position

  • param (int) – The position ID to use when mode is 2

Examples#

Set up mechanism with ID 1#
import hm
import hm.entities as ent

model = hm.Model()

model.mechcontructfromedi(mode=0,param=0)
Apply position with ID 3 on mechanism with ID 1#
import hm
import hm.entities as ent

model = hm.Model()

model.mechcontructfromedi(mode=2,param=3)
model.mechapplyediposition(mode=1,run_solver=0)