*mechapplybodymovements

Moves the bodies of a mechanism to the specified matrix orientation.

Syntax

*mechapplybodymovements bodies_array number_of_bodies matrices_array number_of_matrices number_of_matrix_elements

Type

HyperMesh Tcl Modify

Description

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.

Inputs

bodies_array
The ID of the string array that contains the names of the bodies to update. The array is created using the *createstringarray command. This should always be set to 1.
number_of_bodies
Integer indicating the size (number of bodies) in the array created using *createstringarray. This must be the same as number_of_matrices.
matrices_array
The ID of the double 2D array that contains the 4x3 matrices. The array is created using the *createdoublearray2d command. This should always be set to 1.
The matrix elements are given in the following order:
xaxis1 xaxis2 xaxis3 yaxis1 yaxis2 yaxis3 zaxis1 zaxis2 zaxis3 position1 position2 position3
number_of_matrices
Integer indicating the rows (number of matrices) in the array created using *createdoublearray2d. This must be the same as number_of_bodies.
number_of_matrix_elements
Integer indicating the columns (number of elements per matrix) in the array created using *createdoublearray2d. This must be set to 12.

Examples

To apply position with ID 3 on mechanism with ID 1:

*mechconstructfromedi 2 3
*mechapplybodymovements 1 0

To move 7 bodies with a matrix orientation:

*createstringarray 7 "Fix_Rail" "Move_Rail" "Roller" "Front_Lever" "Rear_Lever"   "Seat_Cushion" "Back_Seat"
*createdoublearray2d 7 12 \
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
*mechapplybodymovements 1 7 1 7 12

Errors

Incorrect usage results in a Tcl error. To detect errors, you can use the catch command:
if { [ catch {command_name...} ] } {
   # Handle error
}

Version History

14.0.120