Model.mechapplybodymovements#
- Model.mechapplybodymovements(bodies_array, matrices_array)#
Moves the bodies of a mechanism to the specified matrix orientation.
The mechanism must have the enabled flag set to true for this to be possible.
This is used internally for solver operations and is not recommended for end-users.
- Parameters:
bodies_array (hwStringList) – The list containing the strings of the names of the bodies to update.
matrices_array (hwDoubleList2) –
The list of lists of doubles that contains the 4x3 matrices.
The matrix elements are given in the following order:
[xaxis1, xaxis2, xaxis3, yaxis1, yaxis2, yaxis3, zaxis1, zaxis2, zaxis3, position1, position2, position3]
Example#
Move 7 bodies with a matrix orientation#import hm import hm.entities as ent model = hm.Model() model.mechapplybodymovements( bodies_array=[ "Fix_Rail", "Move_Rail", "Roller", "Front_Lever", "Rear_Lever", "Seat_Cushion", "Back_Seat", ], matrices_array=[ [1, 0, 0, 0, 1, 0, 0, 0, 1, -1905.69155, 354.020211, 364.071702], [ 0.999999114, -0.000727765047, -0.00111450131, 0.000727161917, 0.999999589, -0.000541475532, 0.00111489492, 0.000540664629, 0.999999232, -1831.77992, 339.826305, 396.010172, ], [ 0.999999996, -8.52472731e-005, 6.68843529e-006, 8.52472333e-005, 0.999999996, 5.95670407e-006, -6.68894306e-006, -5.95613387e-006, 1, -1906.86575, 353.204386, 367.817282, ], [ 0.78961924, -0.00116572455, -0.613596038, 0.00088450914, 0.999999319, -0.000761573242, 0.613596507, 5.86215809e-005, 0.789619733, -1678.57592, 327.008703, 476.854454, ], [ 0.581245504, -0.00107812242, -0.813727535, 0.000811882833, 0.999999393, -0.000744989557, 0.813727844, -0.000227629586, 0.581246027, -2000.582, 334.362031, 476.908588, ], [ 0.994393674, -0.0008628871, -0.105737772, 0.000748529572, 0.999999091, -0.00112120052, 0.105738643, 0.00103576685, 0.994393416, -1782.50488, 333.097311, 547.540308, ], [ 0.994393672, -0.000863464035, -0.105737788, 0.000749102696, 0.999999091, -0.00112126678, 0.10573866, 0.00103577213, 0.994393415, -2112.46025, 320.887101, 909.524211, ], ], )