Model.mechapplyediposition#

Model.mechapplyediposition(mode, run_solver=0)#

Applies a position to a mechanism. This will be always used in conjunction with Model.mechcontructfromedi().

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

Parameters:
  • mode (int) –

    The mode for the position:

    0 - Initial position

    1 - Active position

  • run_solver (int) –

    0 - Directly apply the position to bodies without considering constraints and joints.

    1 - Run the solver to apply the position along with constraints and joints.

Example#

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)